Bug 1000370 - Call SetupCairoFont at the beginning of gfxFont::GetGlyphHAdvance. r=jfkthame

This commit is contained in:
Brian Hackett 2014-04-23 14:12:31 -07:00
parent ccd7a0f0fe
commit 4fd5dc7a93

View File

@ -2031,6 +2031,9 @@ gfxFont::~gfxFont()
gfxFloat
gfxFont::GetGlyphHAdvance(gfxContext *aCtx, uint16_t aGID)
{
if (!SetupCairoFont(aCtx)) {
return 0;
}
if (ProvidesGlyphWidths()) {
return GetGlyphWidth(aCtx, aGID) / 65536.0;
}
@ -2044,7 +2047,7 @@ gfxFont::GetGlyphHAdvance(gfxContext *aCtx, uint16_t aGID)
}
gfxHarfBuzzShaper* shaper =
static_cast<gfxHarfBuzzShaper*>(mHarfBuzzShaper.get());
if (!shaper->Initialize() || !SetupCairoFont(aCtx)) {
if (!shaper->Initialize()) {
return 0;
}
return shaper->GetGlyphHAdvance(aCtx, aGID) / 65536.0;