diff options
author | Fujii Hironori <Hironori.Fujii@sony.com> | 2023-03-03 04:15:10 +0900 |
---|---|---|
committer | Fujii Hironori <Hironori.Fujii@sony.com> | 2023-03-03 04:15:10 +0900 |
commit | aa0aca3c658f47f68cc2b60130634ef32271b021 (patch) | |
tree | 6b4f79cef41edf4476a96f79856d1fac40479488 | |
parent | beb28b76793ac84b0936e9104da058c502797970 (diff) | |
download | cairo-aa0aca3c658f47f68cc2b60130634ef32271b021.tar.gz |
win32 font is very small if the lfHeight of HFONT is exactly -size
cairo_win32_font_face_create_for_hfont is reusing the HFONT object
passed by an argument if possible to create a scaled font. However,
the condition was wrong. It checked the font matrix scale factor is
`-lfHeight`. But it should be `-lfHeight * WIN32_FONT_LOGICAL_SCALE`.
Fixes cairo/cairo#3
-rw-r--r-- | src/win32/cairo-win32-font.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/win32/cairo-win32-font.c b/src/win32/cairo-win32-font.c index fd9461363..a561e74a4 100644 --- a/src/win32/cairo-win32-font.c +++ b/src/win32/cairo-win32-font.c @@ -1798,7 +1798,7 @@ _cairo_win32_font_face_scaled_font_create (void *abstract_face, if (font_face->hfont) { /* Check whether it's OK to go ahead and use the font-face's HFONT. */ if (_is_scale (ctm, 1.) && - _is_scale (font_matrix, -font_face->logfont.lfHeight)) { + _is_scale (font_matrix, -font_face->logfont.lfHeight * WIN32_FONT_LOGICAL_SCALE)) { hfont = font_face->hfont; } } |