From 68a983963a8ef1718400bb7a7f177f5a26ae4656 Mon Sep 17 00:00:00 2001 From: "thestig@chromium.org" Date: Fri, 19 Jun 2009 18:16:04 +0000 Subject: Only select scalable fonts. Fixed-size fonts don't work with FT_Set_Char_Size in SkFontHost_FreeType.cpp. BUG=13007 TEST=On Linux, visit url with { font-family: fixed; } on a computer with pcf fonts. Review URL: http://codereview.chromium.org/131096 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18832 0039d316-1c4b-4281-b951-d872f2087c98 --- skia/ext/SkFontHost_fontconfig_direct.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'skia') diff --git a/skia/ext/SkFontHost_fontconfig_direct.cpp b/skia/ext/SkFontHost_fontconfig_direct.cpp index cb21b0e..5d425c2 100644 --- a/skia/ext/SkFontHost_fontconfig_direct.cpp +++ b/skia/ext/SkFontHost_fontconfig_direct.cpp @@ -118,6 +118,16 @@ 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 = -- cgit v1.1