Bug 1096140 - clean out unused Linux font code. r=m_kato

This commit is contained in:
John Daggett 2014-11-10 15:18:33 +09:00
parent 6e4562500f
commit 5699ac21ba
4 changed files with 1 additions and 49 deletions

View File

@ -598,7 +598,6 @@ gfxFontconfigUtils::UpdateFontListInternal(bool aForce)
mFontsByFamily.Clear();
mFontsByFullname.Clear();
mLangSupportTable.Clear();
mAliasForMultiFonts.Clear();
// Record the existing font families
for (unsigned fs = 0; fs < ArrayLength(fontSets); ++fs) {
@ -632,36 +631,6 @@ gfxFontconfigUtils::UpdateFontListInternal(bool aForce)
}
}
// XXX we don't support all alias names.
// Because if we don't check whether the given font name is alias name,
// fontconfig converts the non existing font to sans-serif.
// This is not good if the web page specifies font-family
// that has Windows font name in the first.
NS_ENSURE_TRUE(Preferences::GetRootBranch(), NS_ERROR_FAILURE);
nsAdoptingCString list = Preferences::GetCString("font.alias-list");
if (!list.IsEmpty()) {
const char kComma = ',';
const char *p, *p_end;
list.BeginReading(p);
list.EndReading(p_end);
while (p < p_end) {
while (nsCRT::IsAsciiSpace(*p)) {
if (++p == p_end)
break;
}
if (p == p_end)
break;
const char *start = p;
while (++p != p_end && *p != kComma)
/* nothing */ ;
nsAutoCString name(Substring(start, p));
name.CompressWhitespace(false, true);
mAliasForMultiFonts.AppendElement(name);
p++;
}
}
mLastConfig = currentConfig;
return NS_OK;
}

View File

@ -302,8 +302,6 @@ protected:
nsTHashtable<LangSupportEntry> mLangSupportTable;
const nsTArray< nsCountedRef<FcPattern> > mEmptyPatternArray;
nsTArray<nsCString> mAliasForMultiFonts;
FcConfig *mLastConfig;
#ifdef MOZ_BUNDLED_FONTS

View File

@ -1227,12 +1227,6 @@ PrepareSortPattern(FcPattern *aPattern, double aFallbackSize,
cairo_font_options_destroy(options);
FcPatternAddBool(aPattern, PRINTING_FC_PROPERTY, FcTrue);
} else {
#ifdef MOZ_GFX_OPTIMIZE_MOBILE
cairo_font_options_t *options = cairo_font_options_create();
cairo_font_options_set_hint_style(options, CAIRO_HINT_STYLE_NONE);
cairo_ft_font_options_substitute(options, aPattern);
cairo_font_options_destroy(options);
#endif
#ifdef MOZ_WIDGET_GTK
ApplyGdkScreenFontOptions(aPattern);
#endif
@ -1965,15 +1959,11 @@ CreateScaledFont(FcPattern *aPattern, cairo_font_face_t *aFace)
// font will be used, but currently we don't have different gfxFonts for
// different surface font_options, so we'll create a font suitable for the
// Screen. Image and xlib surfaces default to CAIRO_HINT_METRICS_ON.
#ifdef MOZ_GFX_OPTIMIZE_MOBILE
cairo_font_options_set_hint_metrics(fontOptions, CAIRO_HINT_METRICS_OFF);
#else
if (printing) {
cairo_font_options_set_hint_metrics(fontOptions, CAIRO_HINT_METRICS_OFF);
} else {
cairo_font_options_set_hint_metrics(fontOptions, CAIRO_HINT_METRICS_ON);
}
#endif
// The remaining options have been recorded on the pattern and the face.
// _cairo_ft_options_merge has some logic to decide which options from the
@ -1998,11 +1988,10 @@ CreateScaledFont(FcPattern *aPattern, cairo_font_face_t *aFace)
//
// Fallback values here mirror treatment of defaults in cairo-ft-font.c.
FcBool hinting = FcFalse;
#ifndef MOZ_GFX_OPTIMIZE_MOBILE
if (FcPatternGetBool(aPattern, FC_HINTING, 0, &hinting) != FcResultMatch) {
hinting = FcTrue;
}
#endif
cairo_hint_style_t hint_style;
if (printing || !hinting) {
hint_style = CAIRO_HINT_STYLE_NONE;

View File

@ -3345,8 +3345,6 @@ pref("layout.css.scroll-behavior.property-enabled", false);
#if defined(ANDROID) || defined(FXOS_SIMULATOR)
// font names
pref("font.alias-list", "sans,sans-serif,serif,monospace");
// Gonk (along with FxOS Simulator) and Android ship different sets of fonts
#if defined(MOZ_WIDGET_GONK) || defined(FXOS_SIMULATOR)
@ -3569,8 +3567,6 @@ pref("print.print_extra_margin", 0); // twips
// font names
pref("font.alias-list", "sans,sans-serif,serif,monospace");
pref("font.size.fixed.ar", 12);
pref("font.name.serif.el", "serif");