mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 21:35:39 +00:00
Bug 414649 - wrong ui font (serif vs sans). Remove FindGenericFontFromStyle. r=pavlov
This commit is contained in:
parent
1e148a8d8b
commit
162beb87e9
@ -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
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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
|
||||
|
@ -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()) {
|
||||
|
Loading…
Reference in New Issue
Block a user