bug 636957 - ensure DWrite font list is initialized in GetFontFamilyList(). r=jdaggett

This commit is contained in:
Jonathan Kew 2011-04-13 08:28:34 +01:00
parent 980d6b87e0
commit 5a633fc5ed
3 changed files with 14 additions and 1 deletions

View File

@ -1102,6 +1102,17 @@ gfxFontFamily* gfxDWriteFontList::FindFamily(const nsAString& aFamily)
return gfxPlatformFontList::FindFamily(aFamily);
}
void
gfxDWriteFontList::GetFontFamilyList(nsTArray<nsRefPtr<gfxFontFamily> >& aFamilyArray)
{
if (!mInitialized) {
mInitialized = PR_TRUE;
DelayedInitFontList();
}
return gfxPlatformFontList::GetFontFamilyList(aFamilyArray);
}
PRBool
gfxDWriteFontList::ResolveFontName(const nsAString& aFontName,
nsAString& aResolvedFontName)

View File

@ -225,6 +225,8 @@ public:
virtual gfxFontFamily* FindFamily(const nsAString& aFamily);
virtual void GetFontFamilyList(nsTArray<nsRefPtr<gfxFontFamily> >& aFamilyArray);
private:
friend class gfxDWriteFontFamily;

View File

@ -93,7 +93,7 @@ public:
void ClearPrefFonts() { mPrefFonts.Clear(); }
void GetFontFamilyList(nsTArray<nsRefPtr<gfxFontFamily> >& aFamilyArray);
virtual void GetFontFamilyList(nsTArray<nsRefPtr<gfxFontFamily> >& aFamilyArray);
gfxFontEntry* FindFontForChar(const PRUint32 aCh, gfxFont *aPrevFont);