Aric Stewart : usp10: ScriptTextOut reorders glyphs that are RTL if they have been processed with fLogicalOrder in previous calls .
Alexandre Julliard
julliard at winehq.org
Thu May 6 11:13:21 CDT 2010
Module: wine
Branch: master
Commit: 2ba0048541d39e8cfef8d2b7c65f824bfd05ccaa
URL: http://source.winehq.org/git/wine.git/?a=commit;h=2ba0048541d39e8cfef8d2b7c65f824bfd05ccaa
Author: Aric Stewart <aric at codeweavers.com>
Date: Wed May 5 13:30:33 2010 -0500
usp10: ScriptTextOut reorders glyphs that are RTL if they have been processed with fLogicalOrder in previous calls.
---
dlls/usp10/usp10.c | 21 +++++++++++++++++++--
1 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c
index b736966..3a7fcd1 100644
--- a/dlls/usp10/usp10.c
+++ b/dlls/usp10/usp10.c
@@ -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;
}
More information about the wine-cvs
mailing list