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

Unified Diff: skia/ext/SkFontHost_fontconfig_direct.cpp

Issue 149437: Linux: don't crash when performing font fallback to a non-scalable font. (Closed)
Patch Set: Created 11 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 | « no previous file | webkit/api/src/gtk/WebFontInfo.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/SkFontHost_fontconfig_direct.cpp
diff --git a/skia/ext/SkFontHost_fontconfig_direct.cpp b/skia/ext/SkFontHost_fontconfig_direct.cpp
index 43a8f00dbce108724770cf1feb3167cb938e1140..9fd1252313a1e24c2064b21d8704c36de4f89647 100644
--- a/skia/ext/SkFontHost_fontconfig_direct.cpp
+++ b/skia/ext/SkFontHost_fontconfig_direct.cpp
@@ -76,6 +76,10 @@ bool FontConfigDirect::Match(std::string* result_family,
fcvalue.u.i = is_italic && *is_italic ? FC_SLANT_ITALIC : FC_SLANT_ROMAN;
FcPatternAdd(pattern, FC_SLANT, fcvalue, 0);
+ fcvalue.type = FcTypeBool;
+ fcvalue.u.b = FcTrue;
+ FcPatternAdd(pattern, FC_SCALABLE, fcvalue, 0);
+
FcConfigSubstitute(0, pattern, FcMatchPattern);
FcDefaultSubstitute(pattern);
@@ -117,16 +121,6 @@ bool FontConfigDirect::Match(std::string* result_family,
return false;
}
- // Skip non-scalable fonts. They don't work with FT_Set_Char_Size()
- // in SkFontHost_FreeType.cpp.
- FcBool scalable = FcFalse;
- FcPatternGetBool(match, FC_SCALABLE, 0, &scalable);
- if (scalable != FcTrue) {
- FcPatternDestroy(match);
- FcPatternDestroy(pattern);
- return false;
- }
-
FcChar8* post_match_family;
FcPatternGetString(match, FC_FAMILY, 0, &post_match_family);
const bool family_names_match =
« no previous file with comments | « no previous file | webkit/api/src/gtk/WebFontInfo.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698