[cairo-commit] 2 commits - src/win32
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Mar 2 21:31:35 UTC 2023
src/win32/cairo-win32-font.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 1f9004b3d0883cd8834b250c584aec31dc8ffadf
Merge: 79c6beee9 aa0aca3c6
Author: Adrian Johnson <ajohnson at redneon.com>
Date: Thu Mar 2 21:31:33 2023 +0000
Merge branch 'issue-3-win32-font-scale' into 'master'
win32 font is very small if the lfHeight of HFONT is exactly -size
Closes #3
See merge request cairo/cairo!466
commit aa0aca3c658f47f68cc2b60130634ef32271b021
Author: Fujii Hironori <Hironori.Fujii at sony.com>
Date: Fri Mar 3 04:15:10 2023 +0900
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
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;
}
}
More information about the cairo-commit
mailing list