Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(235)

Unified Diff: ui/gfx/font_render_params_linux.cc

Issue 523763003: ABANDONED: linux: Avoid bitmaps for Cambria, Calibri, and Consolas. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix strcasecmp() calls Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/font_render_params_linux.cc
diff --git a/ui/gfx/font_render_params_linux.cc b/ui/gfx/font_render_params_linux.cc
index 4f9fbc98b857f59e6aadd1c91c066f3b5fbc4671..2384fbb26a30d91010511c53bcd515069b71d795 100644
--- a/ui/gfx/font_render_params_linux.cc
+++ b/ui/gfx/font_render_params_linux.cc
@@ -112,12 +112,10 @@ bool QueryFontconfig(const FontRenderParamsQuery& query,
if (!match)
return false;
- if (family_out) {
- FcChar8* family = NULL;
- FcPatternGetString(match, FC_FAMILY, 0, &family);
- if (family)
- family_out->assign(reinterpret_cast<const char*>(family));
- }
+ FcChar8* family = NULL;
+ FcPatternGetString(match, FC_FAMILY, 0, &family);
+ if (family && family_out)
+ family_out->assign(reinterpret_cast<const char*>(family));
if (params_out) {
FcBool fc_antialias = 0;
@@ -149,6 +147,15 @@ bool QueryFontconfig(const FontRenderParamsQuery& query,
int fc_rgba = FC_RGBA_NONE;
if (FcPatternGetInteger(match, FC_RGBA, 0, &fc_rgba) == FcResultMatch)
params_out->subpixel_rendering = ConvertFontconfigRgba(fc_rgba);
+
+ // Some Vista fonts ship with embedded bitmaps. Make sure we don't use them
+ // if antialiasing was requested: http://crbug.com/408059
+ if (params_out->antialiasing && family &&
+ (strcasecmp(reinterpret_cast<const char*>(family), "calibri") == 0 ||
+ strcasecmp(reinterpret_cast<const char*>(family), "cambria") == 0 ||
+ strcasecmp(reinterpret_cast<const char*>(family), "consolas") == 0)) {
+ params_out->use_bitmaps = false;
+ }
}
FcPatternDestroy(match);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698