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 height #154
We currently hardcode the glyph height so that we place the line centrally on the line. We should someone deduce the offset from the font metrics (or the shaped text bbox?)
We could do this without a breaking change; just add the ascender property as well. When reading the metrics and we don't have an ascender, we use the current algorithm, if we do have the ascender, we use to to position the font.
Activity
kkaefer commentedon Feb 20, 2014
This needs to happen when shaping the text, and we need to include that information into the shaping result.
mikemorris commentedon Jun 17, 2014
@kkaefer @ansis The glyph ascender is now added to
glyph_infostructs at https://github.com/mapbox/node-fontnik/blob/master/src/mapnik/text/face.cpp#L84-85 and used to offsetglyph.topat https://github.com/mapbox/node-fontnik/blob/master/src/fontnik/glyphs.cpp#L87 - should this offset be removed in favor of shipping the ascender value in the protobuf?ansis commentedon Jun 17, 2014
I think so, but lets see what @kkaefer says. This would be a breaking change, right?
mikemorris commentedon Jun 17, 2014
Yea, it would unfortunately be a breaking change @ansis.
kkaefer commentedon Jun 18, 2014
We could do this without a breaking change; just add the ascender property as well. When reading the metrics and we don't have an ascender, we use the current algorithm, if we do have the ascender, we use to to position the font.
mikemorris commentedon Jun 18, 2014
Opened a pull request enabling this with a few questions at mapbox/node-fontnik#50 @kkaefer @ansis
mikemorris commentedon Jun 18, 2014
Could this be causing mapbox/mapbox-gl-style-spec#61 @nickidlugash?
[-]Do not hardcode label glyph height[/-][+]Use font-provided metadata to determine glyph height[/+]update docs, close #154
lbud commentedon Feb 1, 2017
Inadvertently closed due to some 🌳 history magic — reopening.
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.
fix(core): centre-anchored text on its actual ink, not a hardcoded ba…