aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ports/SkFontHost_win.cpp
diff options
context:
space:
mode:
authorGravatar bungeman <bungeman@google.com>2016-03-22 10:59:09 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-22 10:59:10 -0700
commit59f093d5d832a83b409879de287745e99f75ebfe (patch)
tree4684cdf5b0770263c4e0d5c868be6a56165c7b3d /src/ports/SkFontHost_win.cpp
parentd053ce9c54d4e5937a142278359e5a4cde18095e (diff)
Correctly handle lfWidth in GDI.
The LOGFONT::lfWidth field is related to the LOGFONT::lfHeight field, it is not related in any way to the OS/2::usWidthClass (unlike LOGFONT::lfWeight, which mirrors the OS/2::usWeightClass). Be sure to canonicalize this field to 0 (default) and not use it as a style value. GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1819973003 Review URL: https://codereview.chromium.org/1819973003
Diffstat (limited to 'src/ports/SkFontHost_win.cpp')
-rw-r--r--src/ports/SkFontHost_win.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ports/SkFontHost_win.cpp b/src/ports/SkFontHost_win.cpp
index 10476ad434..8aefd1431a 100644
--- a/src/ports/SkFontHost_win.cpp
+++ b/src/ports/SkFontHost_win.cpp
@@ -120,6 +120,7 @@ static void dcfontname_to_skstring(HDC deviceContext, const LOGFONT& lf, SkStrin
static void make_canonical(LOGFONT* lf) {
lf->lfHeight = -64;
+ lf->lfWidth = 0; // lfWidth is related to lfHeight, not to the OS/2::usWidthClass.
lf->lfQuality = CLEARTYPE_QUALITY;//PROOF_QUALITY;
lf->lfCharSet = DEFAULT_CHARSET;
// lf->lfClipPrecision = 64;
@@ -127,7 +128,7 @@ static void make_canonical(LOGFONT* lf) {
static SkFontStyle get_style(const LOGFONT& lf) {
return SkFontStyle(lf.lfWeight,
- lf.lfWidth,
+ SkFontStyle::kNormal_Width,
lf.lfItalic ? SkFontStyle::kItalic_Slant : SkFontStyle::kUpright_Slant);
}