summaryrefslogtreecommitdiffstats
path: root/skia
diff options
context:
space:
mode:
authoragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-10 01:22:39 +0000
committeragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-10 01:22:39 +0000
commit1e2787f96182fedaf7be62ccf041a8406fa23f8d (patch)
tree5b9720932d650dcda418c84dafd1e0580307ac47 /skia
parentd656353ede2f6a439d12d5fe7b5ac338e2a35fa4 (diff)
downloadchromium_src-1e2787f96182fedaf7be62ccf041a8406fa23f8d.zip
chromium_src-1e2787f96182fedaf7be62ccf041a8406fa23f8d.tar.gz
chromium_src-1e2787f96182fedaf7be62ccf041a8406fa23f8d.tar.bz2
Linux: don't crash when performing font fallback to a non-scalable font.
Previously we were filtering out non-scalable fonts /after/ the fact. This patch changes it so that we specify to fontconfig that it shouldn't return non-scalable fonts to us. We also duplicate this code into WebFontInfo so that we don't get these issues when performing glyph-fallback. http://codereview.chromium.org/149437 BUG=16403 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20351 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia')
-rw-r--r--skia/ext/SkFontHost_fontconfig_direct.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/skia/ext/SkFontHost_fontconfig_direct.cpp b/skia/ext/SkFontHost_fontconfig_direct.cpp
index 43a8f00..9fd1252 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 =