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

Unified Diff: ui/gfx/font_render_params_linux.cc

Issue 407763003: linux: Avoid using unset Fontconfig properties. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: only build font_render_params_linux_unittest.cc when using pango Created 6 years, 5 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 | « ui/gfx/BUILD.gn ('k') | ui/gfx/font_render_params_linux_unittest.cc » ('j') | 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 7bdee19cc809f239f8805a3f942ee5d191e1f41e..bba66d43b5271806ab54c0b93e5b33552df5af90 100644
--- a/ui/gfx/font_render_params_linux.cc
+++ b/ui/gfx/font_render_params_linux.cc
@@ -86,27 +86,34 @@ bool QueryFontconfig(const std::vector<std::string>* family_list,
if (params_out) {
FcBool fc_antialias = 0;
- FcPatternGetBool(match, FC_ANTIALIAS, 0, &fc_antialias);
- params_out->antialiasing = fc_antialias;
+ if (FcPatternGetBool(match, FC_ANTIALIAS, 0, &fc_antialias) ==
+ FcResultMatch) {
+ params_out->antialiasing = fc_antialias;
+ }
FcBool fc_autohint = 0;
- FcPatternGetBool(match, FC_AUTOHINT, 0, &fc_autohint);
- params_out->autohinter = fc_autohint;
+ if (FcPatternGetBool(match, FC_AUTOHINT, 0, &fc_autohint) ==
+ FcResultMatch) {
+ params_out->autohinter = fc_autohint;
+ }
FcBool fc_bitmap = 0;
- FcPatternGetBool(match, FC_EMBEDDED_BITMAP, 0, &fc_bitmap);
- params_out->use_bitmaps = fc_bitmap;
+ if (FcPatternGetBool(match, FC_EMBEDDED_BITMAP, 0, &fc_bitmap) ==
+ FcResultMatch) {
+ params_out->use_bitmaps = fc_bitmap;
+ }
FcBool fc_hinting = 0;
- int fc_hint_style = FC_HINT_NONE;
- FcPatternGetBool(match, FC_HINTING, 0, &fc_hinting);
- if (fc_hinting)
- FcPatternGetInteger(match, FC_HINT_STYLE, 0, &fc_hint_style);
- params_out->hinting = ConvertFontconfigHintStyle(fc_hint_style);
+ if (FcPatternGetBool(match, FC_HINTING, 0, &fc_hinting) == FcResultMatch) {
+ int fc_hint_style = FC_HINT_NONE;
+ if (fc_hinting)
+ FcPatternGetInteger(match, FC_HINT_STYLE, 0, &fc_hint_style);
+ params_out->hinting = ConvertFontconfigHintStyle(fc_hint_style);
+ }
int fc_rgba = FC_RGBA_NONE;
- FcPatternGetInteger(match, FC_RGBA, 0, &fc_rgba);
- params_out->subpixel_rendering = ConvertFontconfigRgba(fc_rgba);
+ if (FcPatternGetInteger(match, FC_RGBA, 0, &fc_rgba) == FcResultMatch)
+ params_out->subpixel_rendering = ConvertFontconfigRgba(fc_rgba);
}
FcPatternDestroy(match);
« no previous file with comments | « ui/gfx/BUILD.gn ('k') | ui/gfx/font_render_params_linux_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698