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

Generated fonts have unequal top- & bottom-whitespace #33

Closed
timhettler opened this issue Dec 17, 2012 · 6 comments
Closed

Generated fonts have unequal top- & bottom-whitespace #33

timhettler opened this issue Dec 17, 2012 · 6 comments
Milestone

Comments

@timhettler
Copy link

When I compile, the resulting fonts are not vertically centered.

As they appear in Illustrator:

Screen Shot 2012-12-17 at 6 31 18 PM

...And then as they appear on a webpage:

Screen Shot 2012-12-17 at 6 33 32 PM

(Deep Pink background added to illustrate unequal whitespace.)

@endtwist
Copy link
Member

Have you tried changing the line-height? This may have something to do with the current font-size and line-height of the icon's parent element.

@timhettler
Copy link
Author

Not a line-height thing. After comparing the font I generated to the one on the fontcustom homepage (and a system font to use as a baseline):

Screen Shot 2012-12-18 at 10 30 29 AM

...It seems pretty clear that it's an issue with either my SVG files, or the compiler. Any chance you could share the file you used to create your fonts? That way I could compile it locally to try and pinpoint where the issue is.

@matthewferry
Copy link

I think this may have something to do with the ascent and descent of the generated glyphs. We actually had some issues with this as well since we were transitioning to use fontcustom from icomoon, where the ascent and descent are modified based on an svg size of 512 and base font size of 16. Fontcustom's generated svg is set at 1000 and the ascent and descent are default. This means whitespace is 0 on the horizontal of the glyph and the glyph will reside on the baseline, NOT at the descender of the font.

The font-forge API has options you can pass, namely fontforge.font().ascent and fontforge.font().descent. Would be nice to include some options to set custom ascender/descender? ...because we had to modify generate.py which is less than ideal ;)

@kaizau
Copy link
Member

kaizau commented Apr 9, 2013

Ascent and descent have been tweaked in 1.0.0.pre — made a bit difference in my tests. @matthewferry I'll add a new issue for your options suggestion.

@kaizau kaizau closed this as completed Apr 9, 2013
@matthewferry
Copy link

Nice! Thanks @EZYZ

@chrisheuberger
Copy link

Has this issue been resolved? I'm trying to set all icons to a consistent baseline no matter their width and can't figure out what to set the font_ascent and font_descent in fontcustom.yml. Thanks.
screen shot 2015-07-09 at 7 19 03 pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants