bug 544617 - ensure Cairo font is set up in gfxGDIFont::InitTextRun. r=jdaggett

This commit is contained in:
Jonathan Kew 2011-03-24 20:11:37 +00:00
parent f99bfbc516
commit 7a650852b8
3 changed files with 5 additions and 3 deletions

View File

@ -155,6 +155,10 @@ gfxGDIFont::InitTextRun(gfxContext *aContext,
PRBool ok = PR_FALSE;
// ensure the cairo font is set up, so there's no risk it'll fall back to
// creating a "toy" font internally (see bug 544617)
SetupCairoFont(aContext);
if (mHarfBuzzShaper) {
if (gfxPlatform::GetPlatform()->UseHarfBuzzLevel() >=
gfxUnicodeProperties::ScriptShapingLevel(aRunScript)) {
@ -484,7 +488,7 @@ gfxGDIFont::GetGlyphWidth(gfxContext *aCtx, PRUint16 aGID)
}
DCFromContext dc(aCtx);
AutoSelectFont fs(dc, GetHFONT());
AutoSelectFont fs(dc, GetHFONT());
int devWidth;
if (GetCharWidthI(dc, aGID, 1, NULL, &devWidth)) {

View File

@ -57,7 +57,6 @@ gfxGDIShaper::InitTextRun(gfxContext *aContext,
PRUint32 aRunLength,
PRInt32 aRunScript)
{
mFont->SetupCairoFont(aContext);
DCFromContext dc(aContext);
nsAutoTArray<WORD,500> glyphArray;

View File

@ -466,7 +466,6 @@ gfxUniscribeShaper::InitTextRun(gfxContext *aContext,
PRUint32 aRunLength,
PRInt32 aRunScript)
{
mFont->SetupCairoFont(aContext);
DCFromContext aDC(aContext);
PRBool result = PR_TRUE;