Huw Davies : usp10: ScriptPlace should honour the fZeroWidth attribute.
Alexandre Julliard
julliard at wine.codeweavers.com
Wed Feb 10 11:11:09 CST 2016
Module: wine
Branch: master
Commit: fc028e99c1c22a7680607101c4a77e34fdb0581e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=fc028e99c1c22a7680607101c4a77e34fdb0581e
Author: Huw Davies <huw at codeweavers.com>
Date: Wed Feb 10 10:59:39 2016 +0000
usp10: ScriptPlace should honour the fZeroWidth attribute.
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Aric Stewart <aric at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
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 408dd29..6fab064 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 1cb77eb..253177a 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)
More information about the wine-cvs
mailing list