Bug 634734 - "Fennec ASSERTION: mFUnitsConvFactor not valid: 'mFUnitsConvFactor > 0.0f" [r=karlt a-2.0=pavlov]
--- a/gfx/thebes/gfxFT2Fonts.cpp
+++ b/gfx/thebes/gfxFT2Fonts.cpp
@@ -680,16 +680,24 @@ gfxFT2Font::InitTextRun(gfxContext *aCon
PRInt32 aRunScript,
PRBool aPreferPlatformShaping)
{
PRBool ok = PR_FALSE;
if (gfxPlatform::GetPlatform()->UseHarfBuzzLevel() >=
gfxUnicodeProperties::ScriptShapingLevel(aRunScript))
{
+ if (!mHarfBuzzShaper)
+ {
+ gfxFT2LockedFace face(this);
+ mFUnitsConvFactor = face.XScale();
+
+ mHarfBuzzShaper = new gfxHarfBuzzShaper(this);
+
+ }
ok = mHarfBuzzShaper->InitTextRun(aContext, aTextRun, aString,
aRunStart, aRunLength, aRunScript);
}
if (!ok) {
AddRange(aTextRun, aString, aRunStart, aRunLength);
}
@@ -798,18 +806,16 @@ gfxFT2Font::AddRange(gfxTextRun *aTextRu
gfxFT2Font::gfxFT2Font(cairo_scaled_font_t *aCairoFont,
FontEntry *aFontEntry,
const gfxFontStyle *aFontStyle)
: gfxFT2FontBase(aCairoFont, aFontEntry, aFontStyle)
{
NS_ASSERTION(mFontEntry, "Unable to find font entry for font. Something is whack.");
mCharGlyphCache.Init(64);
-
- mHarfBuzzShaper = new gfxHarfBuzzShaper(this);
}
gfxFT2Font::~gfxFT2Font()
{
}
cairo_font_face_t *
gfxFT2Font::CairoFontFace()