[PATCH 2/3] gdi32: Avoid best fit chars when mapping unicode character to a glyph index.

Dmitry Timoshkov dmitry at baikal.ru
Tue Dec 15 03:38:41 CST 2020


Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
---
 dlls/gdi32/font.c       | 4 ++--
 dlls/gdi32/tests/font.c | 2 --
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c
index 00bbeb0a11..b8ba4258e9 100644
--- a/dlls/gdi32/font.c
+++ b/dlls/gdi32/font.c
@@ -2910,11 +2910,11 @@ static UINT get_glyph_index( struct gdi_font *font, UINT glyph )
         glyph = get_glyph_index_symbol( font, wc );
         if (!glyph)
         {
-            if (WideCharToMultiByte( CP_ACP, 0, &wc, 1, &ch, 1, NULL, NULL ))
+            if (WideCharToMultiByte( CP_ACP, WC_NO_BEST_FIT_CHARS, &wc, 1, &ch, 1, NULL, NULL ))
                 glyph = get_glyph_index_symbol( font, (unsigned char)ch );
         }
     }
-    else if (WideCharToMultiByte( font->codepage, 0, &wc, 1, &ch, 1, NULL, &used ) && !used)
+    else if (WideCharToMultiByte( font->codepage, WC_NO_BEST_FIT_CHARS, &wc, 1, &ch, 1, NULL, &used ) && !used)
     {
         glyph = (unsigned char)ch;
         font_funcs->get_glyph_index( font, &glyph, FALSE );
diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c
index dde41b501a..f6d2a49c91 100644
--- a/dlls/gdi32/tests/font.c
+++ b/dlls/gdi32/tests/font.c
@@ -1689,9 +1689,7 @@ static void test_GetGlyphIndices(void)
     glyphs[0] = glyphs[1] = 0;
     charcount = GetGlyphIndicesW(hdc, c, ARRAY_SIZE(c), glyphs, GGI_MARK_NONEXISTING_GLYPHS);
     ok(charcount == ARRAY_SIZE(c), "got %u\n", charcount);
-todo_wine
     ok(glyphs[0] == 0x001f || glyphs[0] == 0xffff /* Vista */, "got %#x\n", glyphs[0]);
-todo_wine
     ok(glyphs[1] == 0x001f || glyphs[0] == 0xffff /* Vista */, "got %#x\n", glyphs[1]);
 
     glyphs[0] = glyphs[1] = 0;
-- 
2.29.2




More information about the wine-devel mailing list