diff options
author | bungeman <bungeman@google.com> | 2016-04-27 10:21:04 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-27 10:21:05 -0700 |
commit | b4bb7d825566042ed64697be49457dbac060e6c4 (patch) | |
tree | baad2b4f5125674cc06c06a7d2dd04f7100379c4 /src/utils/win | |
parent | 12135f50bd8d7d8abbb2befb99a9784043cb90e5 (diff) |
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
Diffstat (limited to 'src/utils/win')
-rw-r--r-- | src/utils/win/SkDWrite.h | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/utils/win/SkDWrite.h b/src/utils/win/SkDWrite.h index 60e6a11984..ddcbc6c426 100644 --- a/src/utils/win/SkDWrite.h +++ b/src/utils/win/SkDWrite.h @@ -90,23 +90,18 @@ public: struct DWriteStyle { explicit DWriteStyle(const SkFontStyle& pattern) { - switch (pattern.slant()) { - case SkFontStyle::kUpright_Slant: - fSlant = DWRITE_FONT_STYLE_NORMAL; - break; - case SkFontStyle::kItalic_Slant: - fSlant = DWRITE_FONT_STYLE_ITALIC; - break; - default: - SkASSERT(false); - } - fWeight = (DWRITE_FONT_WEIGHT)pattern.weight(); fWidth = (DWRITE_FONT_STRETCH)pattern.width(); + switch (pattern.slant()) { + case SkFontStyle::kUpright_Slant: fSlant = DWRITE_FONT_STYLE_NORMAL ; break; + case SkFontStyle::kItalic_Slant: fSlant = DWRITE_FONT_STYLE_ITALIC ; break; + case SkFontStyle::kOblique_Slant: fSlant = DWRITE_FONT_STYLE_OBLIQUE; break; + default: SkASSERT(false); break; + } } - DWRITE_FONT_STYLE fSlant; DWRITE_FONT_WEIGHT fWeight; DWRITE_FONT_STRETCH fWidth; + DWRITE_FONT_STYLE fSlant; }; #endif |