usp10: ScriptPlace should honour the fZeroWidth attribute.

Aric Stewart aric at codeweavers.com
Wed Feb 10 09:53:07 CST 2016


Signed-off-by: Aric Stewart <aric at codeweavers.com>

On 2/10/16 4:59 AM, Huw Davies wrote:
> Signed-off-by: Huw Davies <huw at codeweavers.com>
> ---
>   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-patches mailing list