1
0
mirror of https://github.com/wine-mirror/wine synced 2024-06-29 06:14:34 +00:00

gdi32/uniscribe: Ensure the cache is initialised.

Call init_script_cache() in ScriptTextOut() to ensure that a cache
exists for the logic around the ETO_GLYPH_INDEX flag.
This commit is contained in:
Danyil Blyschak 2024-06-24 12:45:10 -05:00 committed by Alexandre Julliard
parent 5e4a5b0be2
commit 09a6d0f291
2 changed files with 3 additions and 1 deletions

View File

@ -3510,7 +3510,7 @@ HRESULT WINAPI ScriptTextOut(const HDC hdc, SCRIPT_CACHE *psc, int x, int y, UIN
int iReserved, const WORD *pwGlyphs, int cGlyphs, const int *piAdvance,
const int *piJustify, const GOFFSET *pGoffset)
{
HRESULT hr = S_OK;
HRESULT hr;
INT i, dir = 1;
INT *lpDx;
WORD *reordered_glyphs = (WORD *)pwGlyphs;
@ -3521,6 +3521,7 @@ HRESULT WINAPI ScriptTextOut(const HDC hdc, SCRIPT_CACHE *psc, int x, int y, UIN
if (!hdc || !psc) return E_INVALIDARG;
if (!piAdvance || !psa || !pwGlyphs) return E_INVALIDARG;
if ((hr = init_script_cache(hdc, psc)) != S_OK) return hr;
fuOptions &= ETO_CLIPPED | ETO_OPAQUE;
fuOptions |= ETO_IGNORELANGUAGE;

View File

@ -2777,6 +2777,7 @@ static void test_ScriptTextOut(HDC hdc)
hr = ScriptTextOut(hdc, &psc, 0, 0, 0, NULL, &pItem[0].a, NULL, 0,
pwOutGlyphs1, pcGlyphs, piAdvance, NULL, pGoffset);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(!!psc, "Got unexpected psc %p.\n", psc);
/* Test Rect Rgn is acceptable. */
SetRect(&rect, 10, 10, 40, 20);