Open kkaefer opened 11 years ago
This needs to happen when shaping the text, and we need to include that information into the shaping result.
@kkaefer @ansis The glyph ascender is now added to glyph_info
structs at https://github.com/mapbox/node-fontnik/blob/master/src/mapnik/text/face.cpp#L84-85 and used to offset glyph.top
at 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?
I think so, but lets see what @kkaefer says. This would be a breaking change, right?
Yea, it would unfortunately be a breaking change @ansis.
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.
Opened a pull request enabling this with a few questions at https://github.com/mapbox/node-fontnik/pull/50 @kkaefer @ansis
Could this be causing https://github.com/mapbox/mapbox-gl-style-spec/issues/61 @nickidlugash?
Inadvertently closed due to some 🌳 history magic — reopening.
Closing as stale. I haven't seen this become a practical concern yet.
Assuming that this will be subsumed by @ChrisLoer's push on fonts + harfbuzz.
Ah! Good point. We can keep this open to track this aspect of our text shaping work.
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?)