You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use font-provided metadata to determine glyph baseline position #191
@ansis Not sure if this ticket is still relevant, but Harfbuzz is not necessary (FreeType is sufficient) for getting ascender (distance from top to baseline) for a font face. I have an open PR at mapbox/node-fontnik#50 for #154 that implements this and adds it to the glyph PBF (note that all glyphs in a face have the same ascender, so the PBF structure could be optimized a bit here)
@ChrisLoer@ansis@kkaefer Is this something we can move on before switching to Harfbuzz? What would it require to accomplish this? It continues to be a visible issue:
Text along lines are often not vertically centered (quite noticeable if the line geometry is also visible, like with road labels along roads).
Labels using multiple fonts (due to font fallbacks for different unicode ranges) can have vertically misaligned glyphs.
Vertically-oriented text along lines using multiple fonts can have awkward spacing or even overlap between glyphs.
Please let me know if there's anything I can do to help resolve this 🙏
@nickidlugash I think this is something we can work on without Harfbuzz. It does unfortunately require server-side changes -- i.e. we need to get node-fontnik to send the metadata down to the client. Hopefully we can add that to the glyph PBF is a backward compatible way, and just use the baseline if it's there, otherwise fall back to our hardwired value.
👋 @tristen - If someone from @mapbox/map-design-team wants to tackle this I'd be happy to help get them up to speed on node-fontnik development. /cc @jseppi@agentpu1011@ian29@brsbl@philogb
Activity
kkaefer commentedon Nov 15, 2013
Why did you close this?
ansis commentedon Nov 16, 2013
Not sure, reopening
mourner commentedon Jun 24, 2014
Should this move to fontserver?
mikemorris commentedon Jul 28, 2014
@ansis Not sure if this ticket is still relevant, but Harfbuzz is not necessary (FreeType is sufficient) for getting
ascender(distance from top to baseline) for a font face. I have an open PR at mapbox/node-fontnik#50 for #154 that implements this and adds it to the glyph PBF (note that all glyphs in a face have the same ascender, so the PBF structure could be optimized a bit here)ansis commentedon Jan 22, 2016
re-opening because this is still hardcoded in -js:
mapbox-gl-js/js/symbol/shaping.js
Line 33 in ec62ab8
ansis commentedon Jan 22, 2016
@mikemorris https://github.com/mapbox/node-fontnik/pull/50/files got merged into master but master doesn't have the ascender version?
mikemorris commentedon Jan 25, 2016
@ansis Looks like we never updated the PBF spec in https://github.com/mapbox/node-fontnik/blob/master/proto/glyphs.proto, I started work on this in mapbox/node-fontnik#97 but it never got merged.
11 remaining items
lucaswoj commentedon Feb 21, 2017
Closing as stale. I haven't seen this become a practical concern yet.
kkaefer commentedon Feb 21, 2017
Assuming that this will be subsumed by @ChrisLoer's push on fonts + harfbuzz.
lucaswoj commentedon Feb 21, 2017
Ah! Good point. We can keep this open to track this aspect of our text shaping work.
nickidlugash commentedon Sep 28, 2017
@ChrisLoer @ansis @kkaefer Is this something we can move on before switching to Harfbuzz? What would it require to accomplish this? It continues to be a visible issue:
Please let me know if there's anything I can do to help resolve this 🙏
ChrisLoer commentedon Sep 28, 2017
@nickidlugash I think this is something we can work on without Harfbuzz. It does unfortunately require server-side changes -- i.e. we need to get node-fontnik to send the metadata down to the client. Hopefully we can add that to the glyph PBF is a backward compatible way, and just use the baseline if it's there, otherwise fall back to our hardwired value.
tristen commentedon Jul 10, 2019
Unearthing this issue as deriving this from a fonts metadata instead of using a fixed value would greatly improve labels using mixed font families.
@springmeyer wanted to put this on your radar. The only related issue I saw in that project was mapbox/node-fontnik#51
mikemorris commentedon Jul 11, 2019
@tristen There's an abandoned PR in which I started most of the work for this at mapbox/node-fontnik#97
springmeyer commentedon Jul 11, 2019
👋 @tristen - If someone from @mapbox/map-design-team wants to tackle this I'd be happy to help get them up to speed on node-fontnik development. /cc @jseppi @agentpu1011 @ian29 @brsbl @philogb
tristen commentedon Aug 6, 2019
Re-earthing @mikemorris's initial work in a new pr mapbox/node-fontnik#160. That should address the downstream work to enable this.