[PATCH 07/12] gdi32: Improve the determine code whether the chracter is the fullwidth.

Byeongsik Jeon bsjeon at hanmail.net
Tue Jan 29 03:12:31 CST 2019


The previous patch causes this hidden problem to be revealed.
MS Korean dual-width fonts(ex. GulimChe), the advance width ratio of these
fonts is not 1:2.

Signed-off-by: Byeongsik Jeon <bsjeon at hanmail.net>
---
 dlls/gdi32/freetype.c   | 4 ++--
 dlls/gdi32/tests/font.c | 1 -
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
index 0759a68412..d0480333ce 100644
--- a/dlls/gdi32/freetype.c
+++ b/dlls/gdi32/freetype.c
@@ -6850,8 +6850,8 @@ static FT_Vector get_advance_metric(GdiFont *incoming_font, GdiFont *font,
                           incoming_font->ft_face->units_per_EM);
         avg_advance = pFT_MulFix(incoming_font->ntmAvgWidth, em_scale);
         fixed_pitch_full = (avg_advance > 0 &&
-                            (base_advance + 63) >> 6 ==
-                            pFT_MulFix(incoming_font->ntmAvgWidth*2, em_scale));
+                            (base_advance + 63) >> 6 !=
+                            pFT_MulFix(incoming_font->ntmAvgWidth, em_scale));
         if (fixed_pitch_full && !transMat)
             adv.x = (avg_advance * 2) << 6;
     }
diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c
index 6e7ac1e8e5..67e8941b5e 100644
--- a/dlls/gdi32/tests/font.c
+++ b/dlls/gdi32/tests/font.c
@@ -4839,7 +4839,6 @@ static void test_GetGlyphOutline(void)
         ok(ret != GDI_ERROR, "GetGlyphOutlineA error %u\n", GetLastError());
         trace("Tests with height=%d,avg=%d,full=%d,face=%s,charset=%d\n",
               -lf.lfHeight, tm.tmAveCharWidth, gm2.gmCellIncX, lf.lfFaceName, lf.lfCharSet);
-        todo_wine
         ok(gm2.gmCellIncX == tm.tmAveCharWidth * 2 || broken(gm2.gmCellIncX == -lf.lfHeight),
            "expected %d, got %d (%s:%d)\n",
            tm.tmAveCharWidth * 2, gm2.gmCellIncX, lf.lfFaceName, lf.lfCharSet);
-- 
2.20.1




More information about the wine-devel mailing list