From 68830f12e7b792ca7f5eeecd02488372d54c04a3 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Fri, 10 Jun 2016 00:44:37 +0200 Subject: [PATCH] usp10: Don't replace control characters with blanks when psa->fNoGlyphIndex is set. Signed-off-by: Henri Verbeet Signed-off-by: Aric Stewart Signed-off-by: Alexandre Julliard --- dlls/usp10/tests/usp10.c | 10 ++++++++++ dlls/usp10/usp10.c | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/dlls/usp10/tests/usp10.c b/dlls/usp10/tests/usp10.c index 2f5ae9e53a1..0014b1ca447 100644 --- a/dlls/usp10/tests/usp10.c +++ b/dlls/usp10/tests/usp10.c @@ -1733,6 +1733,16 @@ static void test_ScriptShape(HDC hdc) "%s: [%02x] expected %04x, got %04x\n", lf.lfFaceName, blanks[j], glyphs[0], glyphs2[0]); ok(attrs[0].fZeroWidth || broken(!attrs[0].fZeroWidth && (blanks[j] < 0x10) /* Vista */), "%s: [%02x] got unexpected fZeroWidth %#x.\n", lf.lfFaceName, blanks[j], attrs[0].fZeroWidth); + + items[0].a.fNoGlyphIndex = 1; + hr = ScriptShape(hdc, &sc, &blanks[j], 1, 1, &items[0].a, glyphs2, logclust, attrs, &nb); + ok(hr == S_OK, "%s: [%02x] expected S_OK, got %08x\n", lf.lfFaceName, blanks[j], hr); + ok(nb == 1, "%s: [%02x] expected 1, got %d\n", lf.lfFaceName, blanks[j], nb); + + ok(glyphs2[0] == blanks[j], + "%s: [%02x] got unexpected %04x.\n", lf.lfFaceName, blanks[j], glyphs2[0]); + ok(!attrs[0].fZeroWidth, "%s: [%02x] got unexpected fZeroWidth %#x.\n", + lf.lfFaceName, blanks[j], attrs[0].fZeroWidth); } if (oldfont) DeleteObject(SelectObject(hdc, oldfont)); diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c index aaa082470b7..07c21758c1e 100644 --- a/dlls/usp10/usp10.c +++ b/dlls/usp10/usp10.c @@ -3177,7 +3177,7 @@ HRESULT WINAPI ScriptShapeOpenType( HDC hdc, SCRIPT_CACHE *psc, pwOutGlyphs[i] = pwcChars[idx]; /* overwrite some basic control glyphs to blank */ - if (psa && psa->eScript == Script_Control && + if (psa && !psa->fNoGlyphIndex && psa->eScript == Script_Control && pwcChars[idx] < ((ScriptCache *)*psc)->tm.tmFirstChar) { if (pwcChars[idx] == 0x0009 || pwcChars[idx] == 0x000A ||