[PATCH 3/5] usp10: Don't replace control characters with blanks when psa->fNoGlyphIndex is set.

Henri Verbeet hverbeet at codeweavers.com
Thu Jun 9 17:44:37 CDT 2016


Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
---
 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 2f5ae9e..0014b1c 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 aaa0824..07c2175 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 ||
-- 
2.1.4




More information about the wine-patches mailing list