Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed param name typo #167

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion bin/svgicons2svgfont.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ program
'creates a monospace font of the width of the largest input icon'
)
.option(
'-c, --centerhorizontally',
'-c, --centerHorizontally',
'calculate the bounds of a glyph and center it horizontally'
)
.option(
Expand Down Expand Up @@ -92,6 +92,7 @@ new SVGIconsDirStream(files, {
normalize: options.normalize,
preserveAspectRatio: options.preserveAspectRatio,
fontHeight: options.height,
fontWeight: options.weight,
round: options.round,
descent: options.descent,
ascent: options.ascent,
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ class SVGIcons2SVGFontStream extends Transform {
glyphPath.getBounds();
if (this._options.centerHorizontally) {
glyphPath.translate(
(glyph.width - (bounds.maxX - bounds.minX)) / 2 - bounds.minX
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not 100% on this

To me this solved my issues with misaligned glyphs but it's best if someone that understands this better gives some feedback

(glyph.width - (bounds.maxX - bounds.minX)) / 2
);
}
if (this._options.centerVertically) {
Expand Down