From fc028e99c1c22a7680607101c4a77e34fdb0581e Mon Sep 17 00:00:00 2001 From: Huw Davies Date: Wed, 10 Feb 2016 10:59:39 +0000 Subject: [PATCH] usp10: ScriptPlace should honour the fZeroWidth attribute. Signed-off-by: Huw Davies Signed-off-by: Aric Stewart Signed-off-by: Alexandre Julliard --- dlls/usp10/tests/usp10.c | 13 +++++++++++++ dlls/usp10/usp10.c | 6 +++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/dlls/usp10/tests/usp10.c b/dlls/usp10/tests/usp10.c index 408dd29d22c..6fab0643472 100644 --- a/dlls/usp10/tests/usp10.c +++ b/dlls/usp10/tests/usp10.c @@ -1747,6 +1747,19 @@ static void test_ScriptPlace(HDC hdc) ok(hr == S_OK, "ScriptPlace should return S_OK not %08x\n", hr); ok(items[0].a.fNoGlyphIndex == FALSE, "fNoGlyphIndex TRUE\n"); + if (widths[0] != 0) + { + int old_width = widths[0]; + attrs[0].fZeroWidth = 1; + + hr = ScriptPlace(hdc, &sc, glyphs, 4, attrs, &items[0].a, widths, offset, NULL); + ok(hr == S_OK, "ScriptPlace should return S_OK not %08x\n", hr); + ok(widths[0] == 0, "got width %d\n", widths[0]); + widths[0] = old_width; + } + else + skip("Glyph already has zero-width - skipping fZeroWidth test\n"); + ret = ExtTextOutW(hdc, 1, 1, 0, NULL, glyphs, 4, widths); ok(ret, "ExtTextOutW should return TRUE\n"); diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c index 1cb77eb4467..253177a12e0 100644 --- a/dlls/usp10/usp10.c +++ b/dlls/usp10/usp10.c @@ -3316,7 +3316,11 @@ HRESULT WINAPI ScriptPlaceOpenType( HDC hdc, SCRIPT_CACHE *psc, SCRIPT_ANALYSIS for (i = 0; i < cGlyphs; i++) { ABC abc; - if (!get_cache_glyph_widths(psc, pwGlyphs[i], &abc)) + if (pGlyphProps[i].sva.fZeroWidth) + { + abc.abcA = abc.abcB = abc.abcC = 0; + } + else if (!get_cache_glyph_widths(psc, pwGlyphs[i], &abc)) { if (!hdc) return E_PENDING; if ((get_cache_pitch_family(psc) & TMPF_TRUETYPE) && !psa->fNoGlyphIndex) -- 2.11.4.GIT