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

Unified Diff: skia/ext/SkFontHost_fontconfig_direct.cpp

Issue 155751: Tries to retrieve all post_match_families in the font to support non-ascii fo... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/SkFontHost_fontconfig_direct.cpp
===================================================================
--- skia/ext/SkFontHost_fontconfig_direct.cpp (リビジョン 21053)
+++ skia/ext/SkFontHost_fontconfig_direct.cpp (作業コピー)
@@ -152,20 +152,30 @@
return false;
}
- FcChar8* post_match_family;
- FcPatternGetString(match, FC_FAMILY, 0, &post_match_family);
- const bool family_names_match =
- family.empty() ?
- true :
- strcasecmp((char *)post_config_family, (char *)post_match_family) == 0;
-
- FcPatternDestroy(pattern);
-
- if (!family_names_match && !IsFallbackFontAllowed(family)) {
+ if (!IsFallbackFontAllowed(family)) {
+ bool family_names_match = false;
+ for (int id = 0; id < 255; ++id) {
+ FcChar8* post_match_family;
+ if (FcPatternGetString(match, FC_FAMILY, id, &post_match_family) !=
+ FcResultMatch)
+ break;
+ family_names_match =
+ family.empty() ?
+ true :
+ strcasecmp((char *)post_config_family,
+ (char *)post_match_family) == 0;
+ if (family_names_match)
+ break;
+ }
+ if (!family.empty() && !family_names_match) {
+ FcPatternDestroy(pattern);
FcFontSetDestroy(font_set);
return false;
+ }
}
+ FcPatternDestroy(pattern);
+
FcChar8* c_filename;
if (FcPatternGetString(match, FC_FILE, 0, &c_filename) != FcResultMatch) {
FcFontSetDestroy(font_set);
« 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