commit | b4bb7d825566042ed64697be49457dbac060e6c4 | [log] [tgz] |
---|---|---|
author | bungeman <bungeman@google.com> | Wed Apr 27 10:21:04 2016 -0700 |
committer | Commit bot <commit-bot@chromium.org> | Wed Apr 27 10:21:05 2016 -0700 |
tree | baad2b4f5125674cc06c06a7d2dd04f7100379c4 | |
parent | 12135f50bd8d7d8abbb2befb99a9784043cb90e5 [diff] [blame] |
Add oblique as a slant. Some fonts have italic and oblique in the same family, see http://lucidafonts.com/fonts/family/lucida-sans http://www.gust.org.pl/projects/e-foundry/latin-modern GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1921903002 Chromium side change at https://crrev.com/1921503006/ . Review-Url: https://codereview.chromium.org/1921903002
diff --git a/src/ports/SkFontHost_mac.cpp b/src/ports/SkFontHost_mac.cpp index 02c5464..72d4690 100644 --- a/src/ports/SkFontHost_mac.cpp +++ b/src/ports/SkFontHost_mac.cpp
@@ -417,7 +417,7 @@ 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 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) {