bug 470440. Disable hinting on mobile to avoid some text spacing issues. r=karlt

This commit is contained in:
Stuart Parmenter 2009-12-30 00:13:38 -08:00
parent 00e316ca4e
commit 4d425088eb

View File

@ -1739,12 +1739,17 @@ PrepareSortPattern(FcPattern *aPattern, double aFallbackSize,
cairo_font_options_set_antialias (options, CAIRO_ANTIALIAS_GRAY); cairo_font_options_set_antialias (options, CAIRO_ANTIALIAS_GRAY);
cairo_ft_font_options_substitute(options, aPattern); cairo_ft_font_options_substitute(options, aPattern);
cairo_font_options_destroy(options); cairo_font_options_destroy(options);
} } else {
#ifdef MOZ_WIDGET_GTK2 #ifdef MOZ_GFX_OPTIMIZE_MOBILE
else { cairo_font_options_t *options = cairo_font_options_create();
ApplyGdkScreenFontOptions(aPattern); cairo_font_options_set_hint_style(options, CAIRO_HINT_STYLE_NONE);
} cairo_ft_font_options_substitute(options, aPattern);
cairo_font_options_destroy(options);
#endif #endif
#ifdef MOZ_WIDGET_GTK2
ApplyGdkScreenFontOptions(aPattern);
#endif
}
// Protect against any fontconfig settings that may have incorrectly // Protect against any fontconfig settings that may have incorrectly
// modified the pixelsize, and consider aSizeAdjustFactor. // modified the pixelsize, and consider aSizeAdjustFactor.
@ -2521,7 +2526,11 @@ CreateScaledFont(FcPattern *aPattern)
// font will be used, but currently we don't have different gfxFonts for // 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 // different surface font_options, so we'll create a font suitable for the
// Screen. Image and xlib surfaces default to CAIRO_HINT_METRICS_ON. // 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
cairo_font_options_set_hint_metrics(fontOptions, CAIRO_HINT_METRICS_ON); cairo_font_options_set_hint_metrics(fontOptions, CAIRO_HINT_METRICS_ON);
#endif
// The remaining options have been recorded on the pattern and the face. // 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 // _cairo_ft_options_merge has some logic to decide which options from the
@ -2545,10 +2554,12 @@ CreateScaledFont(FcPattern *aPattern)
// use the setting from the FcPattern. // use the setting from the FcPattern.
// //
// Fallback values here mirror treatment of defaults in cairo-ft-font.c. // Fallback values here mirror treatment of defaults in cairo-ft-font.c.
FcBool hinting; FcBool hinting = FcFalse;
#ifndef MOZ_GFX_OPTIMIZE_MOBILE
if (FcPatternGetBool(aPattern, FC_HINTING, 0, &hinting) != FcResultMatch) { if (FcPatternGetBool(aPattern, FC_HINTING, 0, &hinting) != FcResultMatch) {
hinting = FcTrue; hinting = FcTrue;
} }
#endif
cairo_hint_style_t hint_style; cairo_hint_style_t hint_style;
if (!hinting) { if (!hinting) {
hint_style = CAIRO_HINT_STYLE_NONE; hint_style = CAIRO_HINT_STYLE_NONE;