usp10: ScriptTextOut reorders glyphs that are RTL if they have been processed with fLogicalOrder in previous calls.

This commit is contained in:
Aric Stewart 2010-05-05 13:30:33 -05:00 committed by Alexandre Julliard
parent abae85b976
commit 2ba0048541
1 changed files with 19 additions and 2 deletions

View File

@ -1578,8 +1578,25 @@ HRESULT WINAPI ScriptTextOut(const HDC hdc, SCRIPT_CACHE *psc, int x, int y, UIN
if (!psa->fNoGlyphIndex) /* Have Glyphs? */
fuOptions |= ETO_GLYPH_INDEX; /* Say don't do translation to glyph */
if (!ExtTextOutW(hdc, x, y, fuOptions, lprc, pwGlyphs, cGlyphs, NULL))
hr = S_FALSE;
if (psa->fRTL && psa->fLogicalOrder)
{
int i;
WORD *rtlGlyphs;
rtlGlyphs = heap_alloc(cGlyphs * sizeof(WORD));
if (!rtlGlyphs)
return E_OUTOFMEMORY;
for (i = 0; i < cGlyphs; i++)
rtlGlyphs[i] = pwGlyphs[cGlyphs-1-i];
if (!ExtTextOutW(hdc, x, y, fuOptions, lprc, rtlGlyphs, cGlyphs, NULL))
hr = S_FALSE;
heap_free(rtlGlyphs);
}
else
if (!ExtTextOutW(hdc, x, y, fuOptions, lprc, pwGlyphs, cGlyphs, NULL))
hr = S_FALSE;
return hr;
}