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

Side by Side Diff: src/ports/SkFontConfigInterface_direct.cpp

Issue 23684041: improve bitmap font support (FreeType only) (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/ports/SkFontHost_FreeType.cpp » ('j') | src/ports/SkFontHost_FreeType.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2009 Google Inc. 2 * Copyright 2009 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 /* migrated from chrome/src/skia/ext/SkFontHost_fontconfig_direct.cpp */ 8 /* migrated from chrome/src/skia/ext/SkFontHost_fontconfig_direct.cpp */
9 9
10 #include <string> 10 #include <string>
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 // tells you whether a given request is for such a fallback. 323 // tells you whether a given request is for such a fallback.
324 bool IsFallbackFontAllowed(const std::string& family) { 324 bool IsFallbackFontAllowed(const std::string& family) {
325 const char* family_cstr = family.c_str(); 325 const char* family_cstr = family.c_str();
326 return family.empty() || 326 return family.empty() ||
327 strcasecmp(family_cstr, "sans") == 0 || 327 strcasecmp(family_cstr, "sans") == 0 ||
328 strcasecmp(family_cstr, "serif") == 0 || 328 strcasecmp(family_cstr, "serif") == 0 ||
329 strcasecmp(family_cstr, "monospace") == 0; 329 strcasecmp(family_cstr, "monospace") == 0;
330 } 330 }
331 331
332 static bool valid_pattern(FcPattern* pattern) { 332 static bool valid_pattern(FcPattern* pattern) {
333 FcBool is_scalable; 333 // FcBool is_scalable;
reed1 2013/12/09 16:58:42 Why is this section commented out? Can we delete i
bungeman-skia 2013/12/09 19:42:44 This change is required so that bitmap fonts are n
334 if (FcPatternGetBool(pattern, FC_SCALABLE, 0, &is_scalable) != FcResultMatch 334 // if (FcPatternGetBool(pattern, FC_SCALABLE, 0, &is_scalable) != FcResultMat ch
335 || !is_scalable) { 335 // || !is_scalable) {
336 return false; 336 // return false;
337 } 337 // }
338 338
339 // fontconfig can also return fonts which are unreadable 339 // fontconfig can also return fonts which are unreadable
340 const char* c_filename = get_name(pattern, FC_FILE); 340 const char* c_filename = get_name(pattern, FC_FILE);
341 if (!c_filename) { 341 if (!c_filename) {
342 return false; 342 return false;
343 } 343 }
344 if (access(c_filename, R_OK) != 0) { 344 if (access(c_filename, R_OK) != 0) {
345 return false; 345 return false;
346 } 346 }
347 return true; 347 return true;
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 *trimmedMatches.append() = match[i]; 725 *trimmedMatches.append() = match[i];
726 } 726 }
727 } 727 }
728 728
729 SkFontStyleSet_FC* sset = SkNEW_ARGS(SkFontStyleSet_FC, 729 SkFontStyleSet_FC* sset = SkNEW_ARGS(SkFontStyleSet_FC,
730 (trimmedMatches.begin(), 730 (trimmedMatches.begin(),
731 trimmedMatches.count())); 731 trimmedMatches.count()));
732 #endif 732 #endif
733 return false; 733 return false;
734 } 734 }
OLDNEW
« no previous file with comments | « no previous file | src/ports/SkFontHost_FreeType.cpp » ('j') | src/ports/SkFontHost_FreeType.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698