mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-23 18:26:15 +00:00
Bug 1430216 - For non-scalable fonts, we can't use the linearHoriAdvance field from the glyph slot; use the advance field instead to get proper metrics. r=lsalzman
This commit is contained in:
parent
37efe4d0e6
commit
42e35bdbd0
@ -519,7 +519,11 @@ gfxFT2FontBase::GetFTGlyphAdvance(uint16_t aGID)
|
||||
mozilla::DebugOnly<FT_Error> ftError =
|
||||
FT_Load_Glyph(face.get(), aGID, flags);
|
||||
MOZ_ASSERT(!ftError);
|
||||
advance = face.get()->glyph->linearHoriAdvance;
|
||||
if (face.get()->face_flags & FT_FACE_FLAG_SCALABLE) {
|
||||
advance = face.get()->glyph->linearHoriAdvance;
|
||||
} else {
|
||||
advance = face.get()->glyph->advance.x << 10; // convert 26.6 to 16.16
|
||||
}
|
||||
|
||||
// If freetype emboldening is being used, and it's not a zero-width glyph,
|
||||
// adjust the advance to account for the increased width.
|
||||
|
Loading…
Reference in New Issue
Block a user