Bug 414649 - wrong ui font (serif vs sans). Remove FindGenericFontFromStyle. r=pavlov

This commit is contained in:
karlt+@karlt.net 2008-02-11 22:43:26 -08:00
parent 7f4835d63a
commit 279c4c2019
4 changed files with 0 additions and 49 deletions

View File

@ -1469,10 +1469,6 @@ protected:
FontCreationCallback fc,
void *closure);
/* this will call back fc with the a generic font based on the style's langgroup */
void FindGenericFontFromStyle(PRBool aResolveFontName,
FontCreationCallback fc, void *closure);
static PRBool FontResolverProc(const nsAString& aName, void *aClosure);
};
#endif

View File

@ -810,48 +810,6 @@ gfxFontGroup::FontResolverProc(const nsAString& aName, void *aClosure)
return (data->mCallback)(aName, data->mGenericFamily, data->mClosure);
}
void
gfxFontGroup::FindGenericFontFromStyle(PRBool aResolveFontName,
FontCreationCallback fc,
void *closure)
{
nsCOMPtr<nsIPref> prefs(do_GetService(NS_PREF_CONTRACTID));
if (!prefs)
return;
nsCAutoString prefName;
nsXPIDLString genericName;
nsXPIDLString familyName;
// add the default font to the end of the list
prefName.AssignLiteral("font.default.");
prefName.Append(mStyle.langGroup);
nsresult rv = prefs->CopyUnicharPref(prefName.get(), getter_Copies(genericName));
if (NS_SUCCEEDED(rv)) {
prefName.AssignLiteral("font.name.");
prefName.Append(NS_LossyConvertUTF16toASCII(genericName));
prefName.AppendLiteral(".");
prefName.Append(mStyle.langGroup);
rv = prefs->CopyUnicharPref(prefName.get(), getter_Copies(familyName));
if (NS_SUCCEEDED(rv)) {
ForEachFontInternal(familyName, mStyle.langGroup,
PR_FALSE, aResolveFontName, fc, closure);
}
prefName.AssignLiteral("font.name-list.");
prefName.Append(NS_LossyConvertUTF16toASCII(genericName));
prefName.AppendLiteral(".");
prefName.Append(mStyle.langGroup);
rv = prefs->CopyUnicharPref(prefName.get(), getter_Copies(familyName));
if (NS_SUCCEEDED(rv)) {
ForEachFontInternal(familyName, mStyle.langGroup,
PR_FALSE, aResolveFontName, fc, closure);
}
}
}
gfxTextRun *
gfxFontGroup::MakeEmptyTextRun(const Parameters *aParams, PRUint32 aFlags)
{

View File

@ -429,7 +429,6 @@ gfxOS2FontGroup::gfxOS2FontGroup(const nsAString& aFamilies,
nsStringArray familyArray;
ForEachFont(FontCallback, &familyArray);
FindGenericFontFromStyle(PR_TRUE, FontCallback, &familyArray);
// To be able to easily search for glyphs in other fonts, append a few good
// replacement candidates to the list. The best ones are the Unicode fonts that

View File

@ -164,8 +164,6 @@ gfxPangoFontGroup::gfxPangoFontGroup (const nsAString& families,
ForEachFontInternal(families, aStyle->langGroup, PR_TRUE, PR_FALSE,
FontCallback, &familyArray);
FindGenericFontFromStyle(PR_FALSE, FontCallback, &familyArray);
// Construct a string suitable for fontconfig
nsAutoString fcFamilies;
if (familyArray.Count()) {