-
Notifications
You must be signed in to change notification settings - Fork 13
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
Handle fontstack ascender/descender metadata #11
Comments
Have you tested this yet? Do most fonts use the same ascender/descender values such that the customized values will usually be respected? Or is it going to be very rare that we will not just zero them out? |
@springmeyer When fonts from the same family are composited, then I think the customized ascender/descender values are likely to be the same. For example, in this test case with two different "Lato" variations being composited: https://github.com/mapbox/glyph-pbf-composite/pull/12/files#diff-c1129c8b045390789fa8ff62f2c6b4a9R132-R144 |
@springmeyer Does this sound ok to you? |
@jseppi Thanks for the explanation. It seems like that is fine assuming users have control over their entire fontstack and understand the implications of each font they choose in the fontstack. |
Related to mapbox/node-fontnik#160
When/if mapbox/node-fontnik#160 is shipped, the new
ascender
anddescender
metadata fields will need to be handled here as well (unless the functionality of this repo is moved intonode-fontnik
-- mapbox/node-fontnik#163).We'll also need to figure out the desired behavior of combining ascender/descender metadata from the multiple fonts being composited. In discussing with @tristen, we think the compositing of that metadata should be: if all fonts in the composite have the same ascender/descender values, then use those, but if any are different, then use 0 (falling back to the current fixed value)
In summary:
ascender
anddescender
tofontstack
inglyphs.proto
, as in https://github.com/mapbox/node-fontnik/pull/160/files#diff-f5607f797a3301f210b1a4e9f7db4ffdR30-R31ascender
/descender
compositing in.composite()
Ref:
descender
andascender
for font metrics + fix several text rendering issues mapbox-gl-js#8781The text was updated successfully, but these errors were encountered: