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

Unified Diff: skia/ext/SkFontHost_fontconfig.cpp

Issue 147005: Linux: fix fake italics for font's without italic variants. (Closed)
Patch Set: ... Created 11 years, 6 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 | « chrome/browser/renderer_host/render_sandbox_host_linux.cc ('k') | skia/ext/SkFontHost_fontconfig_direct.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/SkFontHost_fontconfig.cpp
diff --git a/skia/ext/SkFontHost_fontconfig.cpp b/skia/ext/SkFontHost_fontconfig.cpp
index 04ac5b9d214338197d29477741e5ff17dfbf341e..2ecbe6c73b0a863bd9d5936c36d7383c0277af82 100644
--- a/skia/ext/SkFontHost_fontconfig.cpp
+++ b/skia/ext/SkFontHost_fontconfig.cpp
@@ -101,7 +101,7 @@ SkTypeface* SkFontHost::CreateTypeface(const SkTypeface* familyFace,
const unsigned fileid = UniqueIdToFileId(familyFace->uniqueID());
if (!GetFcImpl()->Match(
&resolved_family_name, NULL, true /* fileid valid */, fileid, "",
- -1, -1)) {
+ NULL, NULL)) {
return NULL;
}
} else if (familyName) {
@@ -110,16 +110,19 @@ SkTypeface* SkFontHost::CreateTypeface(const SkTypeface* familyFace,
return NULL;
}
- const bool bold = style & SkTypeface::kBold;
- const bool italic = style & SkTypeface::kItalic;
+ bool bold = style & SkTypeface::kBold;
+ bool italic = style & SkTypeface::kItalic;
unsigned fileid;
if (!GetFcImpl()->Match(NULL, &fileid, false, -1, /* no fileid */
- resolved_family_name, bold, italic)) {
+ resolved_family_name, &bold, &italic)) {
return NULL;
}
+ const SkTypeface::Style resulting_style = static_cast<SkTypeface::Style>(
+ (bold ? SkTypeface::kBold : 0) |
+ (italic ? SkTypeface::kItalic : 0));
- const unsigned id = FileIdAndStyleToUniqueId(fileid, style);
- SkTypeface* typeface = SkNEW_ARGS(FontConfigTypeface, (style, id));
+ const unsigned id = FileIdAndStyleToUniqueId(fileid, resulting_style);
+ SkTypeface* typeface = SkNEW_ARGS(FontConfigTypeface, (resulting_style, id));
{
SkAutoMutexAcquire ac(global_fc_map_lock);
« no previous file with comments | « chrome/browser/renderer_host/render_sandbox_host_linux.cc ('k') | skia/ext/SkFontHost_fontconfig_direct.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698