This part fixes GetGlyphIndices.
Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- dlls/gdi32/font.c | 2 +- dlls/gdi32/tests/font.c | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index 00bbeb0a11..9380d3efbe 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -3223,7 +3223,7 @@ static DWORD CDECL font_GetGlyphIndices( PHYSDEV dev, const WCHAR *str, INT coun if (str[i] >= 0xf020 && str[i] <= 0xf100) glyph = str[i] - 0xf000; else if (str[i] < 0x100) glyph = str[i]; } - else if (WideCharToMultiByte( physdev->font->codepage, 0, &str[i], 1, + else if (WideCharToMultiByte( physdev->font->codepage, WC_NO_BEST_FIT_CHARS, &str[i], 1, &ch, 1, NULL, &used ) && !used) glyph = (unsigned char)ch; } diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c index c630b65e5e..5eb069bf31 100644 --- a/dlls/gdi32/tests/font.c +++ b/dlls/gdi32/tests/font.c @@ -1690,14 +1690,12 @@ static void test_GetGlyphIndices(void) charcount = GetGlyphIndicesW(hdc, c, ARRAY_SIZE(c), glyphs, GGI_MARK_NONEXISTING_GLYPHS); ok(charcount == ARRAY_SIZE(c), "got %u\n", charcount); ok(glyphs[0] == 0x001f || glyphs[0] == 0xffff /* Vista */, "got %#x\n", glyphs[0]); -todo_wine ok(glyphs[1] == 0x001f || glyphs[1] == 0xffff /* Vista */, "got %#x\n", glyphs[1]);
glyphs[0] = glyphs[1] = 0; charcount = GetGlyphIndicesW(hdc, c, ARRAY_SIZE(c), glyphs, 0); ok(charcount == ARRAY_SIZE(c), "got %u\n", charcount); ok(glyphs[0] == textm.tmDefaultChar || glyphs[0] == 0x20 /* CJK Windows */, "got %#x\n", glyphs[0]); -todo_wine ok(glyphs[1] == textm.tmDefaultChar || glyphs[1] == 0x20 /* CJK Windows */, "got %#x\n", glyphs[1]);
DeleteObject(SelectObject(hdc, hOldFont));
On Tue, Dec 15, 2020 at 03:04:46PM +0300, Dmitry Timoshkov wrote:
This part fixes GetGlyphIndices.
Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru
dlls/gdi32/font.c | 2 +- dlls/gdi32/tests/font.c | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index 00bbeb0a11..9380d3efbe 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -3223,7 +3223,7 @@ static DWORD CDECL font_GetGlyphIndices( PHYSDEV dev, const WCHAR *str, INT coun if (str[i] >= 0xf020 && str[i] <= 0xf100) glyph = str[i] - 0xf000; else if (str[i] < 0x100) glyph = str[i]; }
else if (WideCharToMultiByte( physdev->font->codepage, 0, &str[i], 1,
else if (WideCharToMultiByte( physdev->font->codepage, WC_NO_BEST_FIT_CHARS, &str[i], 1, &ch, 1, NULL, &used ) && !used) glyph = (unsigned char)ch; }
Hi Dmitry,
I suspect this should wait until after 6.0. What app does this fix?
Huw.
Hi Huw,
thanks for the review.
Huw Davies huw@codeweavers.com wrote:
--- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -3223,7 +3223,7 @@ static DWORD CDECL font_GetGlyphIndices( PHYSDEV dev, const WCHAR *str, INT coun if (str[i] >= 0xf020 && str[i] <= 0xf100) glyph = str[i] - 0xf000; else if (str[i] < 0x100) glyph = str[i]; }
else if (WideCharToMultiByte( physdev->font->codepage, 0, &str[i], 1,
else if (WideCharToMultiByte( physdev->font->codepage, WC_NO_BEST_FIT_CHARS, &str[i], 1, &ch, 1, NULL, &used ) && !used) glyph = (unsigned char)ch; }
Hi Dmitry,
I suspect this should wait until after 6.0.
I'm OK with deferring 2/4 and 3/4, however I hope that 1/4 (tests) and 4/4 (MS Sans Serif default glyph index) could be accepted, 4/4 doesn't depend on previous patches in the series.
What app does this fix?
The application that the patches fix is not publicly available.
On Mon, Dec 21, 2020 at 03:21:10PM +0300, Dmitry Timoshkov wrote:
I suspect this should wait until after 6.0.
I'm OK with deferring 2/4 and 3/4, however I hope that 1/4 (tests) and 4/4 (MS Sans Serif default glyph index) could be accepted, 4/4 doesn't depend on previous patches in the series.
Sounds good. I've sent in a v3 of 1/4 as v2 has conflicts with a recent change. I've also signed off 4/4.
Huw.