Bug 1056479 p1 - add language to FindFamily parameters. r=jfkthame

This commit is contained in:
John Daggett 2015-05-12 14:51:17 +09:00
parent dcbe3ab36f
commit dae9a5b2b6
7 changed files with 13 additions and 4 deletions

View File

@ -1304,7 +1304,9 @@ gfxDWriteFontList::GetStandardFamilyName(const nsAString& aFontName,
}
gfxFontFamily*
gfxDWriteFontList::FindFamily(const nsAString& aFamily, bool aUseSystemFonts)
gfxDWriteFontList::FindFamily(const nsAString& aFamily,
nsIAtom* aLanguage,
bool aUseSystemFonts)
{
if (!mInitialized) {
mInitialized = true;

View File

@ -365,6 +365,7 @@ public:
bool UseGDIFontTableAccess() { return mGDIFontTableAccess; }
virtual gfxFontFamily* FindFamily(const nsAString& aFamily,
nsIAtom* aLanguage = nullptr,
bool aUseSystemFonts = false);
virtual void GetFontFamilyList(nsTArray<nsRefPtr<gfxFontFamily> >& aFamilyArray);

View File

@ -830,7 +830,9 @@ gfxGDIFontList::MakePlatformFont(const nsAString& aFontName,
}
gfxFontFamily*
gfxGDIFontList::FindFamily(const nsAString& aFamily, bool aUseSystemFonts)
gfxGDIFontList::FindFamily(const nsAString& aFamily,
nsIAtom* aLanguage,
bool aUseSystemFonts)
{
nsAutoString keyName(aFamily);
BuildKeyNameFromFontName(keyName);

View File

@ -310,6 +310,7 @@ public:
virtual gfxFontFamily* GetDefaultFont(const gfxFontStyle* aStyle);
virtual gfxFontFamily* FindFamily(const nsAString& aFamily,
nsIAtom* aLanguage = nullptr,
bool aUseSystemFonts = false);
virtual gfxFontEntry* LookupLocalFont(const nsAString& aFontName,

View File

@ -726,7 +726,9 @@ gfxPlatformFontList::CheckFamily(gfxFontFamily *aFamily)
}
gfxFontFamily*
gfxPlatformFontList::FindFamily(const nsAString& aFamily, bool aUseSystemFonts)
gfxPlatformFontList::FindFamily(const nsAString& aFamily,
nsIAtom* aLanguage,
bool aUseSystemFonts)
{
nsAutoString key;
gfxFontFamily *familyEntry;

View File

@ -126,6 +126,7 @@ public:
const gfxFontStyle* aStyle);
virtual gfxFontFamily* FindFamily(const nsAString& aFamily,
nsIAtom* aLanguage = nullptr,
bool aUseSystemFonts = false);
gfxFontEntry* FindFontForFamily(const nsAString& aFamily, const gfxFontStyle* aStyle, bool& aNeedsBold);

View File

@ -1724,7 +1724,7 @@ gfxFontGroup::FindPlatformFont(const nsAString& aName,
// Not known in the user font set ==> check system fonts
if (!family) {
gfxPlatformFontList *fontList = gfxPlatformFontList::PlatformFontList();
family = fontList->FindFamily(aName, mStyle.systemFont);
family = fontList->FindFamily(aName, mStyle.language, mStyle.systemFont);
if (family) {
fe = family->FindFontForStyle(mStyle, needsBold);
}