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

Unified Diff: src/ports/SkFontHost_mac.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/ports/SkFontHost_FreeType.cpp ('k') | src/ports/SkFontHost_win.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkFontHost_mac.cpp
diff --git a/src/ports/SkFontHost_mac.cpp b/src/ports/SkFontHost_mac.cpp
index 02c54640bbed585f9e345a34d41b15cb6eb3b4b2..72d4690870f4d54139b397055df95feb4f0a57d2 100644
--- a/src/ports/SkFontHost_mac.cpp
+++ b/src/ports/SkFontHost_mac.cpp
@@ -417,7 +417,7 @@ static SkFontStyle fontstyle_from_descriptor(CTFontDescriptorRef desc) {
return SkFontStyle(unit_weight_to_fontstyle(weight),
unit_width_to_fontstyle(width),
slant ? SkFontStyle::kItalic_Slant
- : SkFontStyle::kUpright_Slant);
+ : SkFontStyle::kUpright_Slant);
}
#define WEIGHT_THRESHOLD ((SkFontStyle::kNormal_Weight + SkFontStyle::kBold_Weight)/2)
@@ -2151,7 +2151,7 @@ static inline int sqr(int value) {
static int compute_metric(const SkFontStyle& a, const SkFontStyle& b) {
return sqr(a.weight() - b.weight()) +
sqr((a.width() - b.width()) * 100) +
- sqr((a.isItalic() != b.isItalic()) * 900);
+ sqr((a.slant() != b.slant()) * 900);
}
static SkTypeface* createFromDesc(CTFontDescriptorRef desc) {
« no previous file with comments | « src/ports/SkFontHost_FreeType.cpp ('k') | src/ports/SkFontHost_win.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698