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

Unified Diff: src/core/SkTypeface.cpp

Issue 1921903002: Add oblique as a slant. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: static_assert what can be. Created 4 years, 8 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 | « src/core/SkFontStyle.cpp ('k') | src/fonts/SkFontMgr_fontconfig.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkTypeface.cpp
diff --git a/src/core/SkTypeface.cpp b/src/core/SkTypeface.cpp
index 855ef909e8c4c17a53c60bb5b708086efbe94391..d768efc60365d8f972c39b66c00e4c522c1745bd 100644
--- a/src/core/SkTypeface.cpp
+++ b/src/core/SkTypeface.cpp
@@ -138,14 +138,7 @@ SkTypeface* SkTypeface::CreateFromTypeface(const SkTypeface* family, Style s) {
}
SkAutoTUnref<SkFontMgr> fm(SkFontMgr::RefDefault());
- bool bold = s & SkTypeface::kBold;
- bool italic = s & SkTypeface::kItalic;
- SkFontStyle newStyle = SkFontStyle(bold ? SkFontStyle::kBold_Weight
- : SkFontStyle::kNormal_Weight,
- SkFontStyle::kNormal_Width,
- italic ? SkFontStyle::kItalic_Slant
- : SkFontStyle::kUpright_Slant);
- return fm->matchFaceStyle(family, newStyle);
+ return fm->matchFaceStyle(family, SkFontStyle::FromOldStyle(s));
}
SkTypeface* SkTypeface::CreateFromStream(SkStreamAsset* stream, int index) {
« no previous file with comments | « src/core/SkFontStyle.cpp ('k') | src/fonts/SkFontMgr_fontconfig.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698