diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c index 9659e663474..9bd55b4618e 100644 --- a/dlls/usp10/usp10.c +++ b/dlls/usp10/usp10.c @@ -788,6 +788,7 @@ static inline BOOL set_cache_glyph_widths(SCRIPT_CACHE *psc, WORD glyph, ABC *ab static HRESULT init_script_cache(const HDC hdc, SCRIPT_CACHE *psc) { ScriptCache *sc; + int size; if (!psc) return E_INVALIDARG; if (*psc) return S_OK; @@ -799,6 +800,13 @@ static HRESULT init_script_cache(const HDC hdc, SCRIPT_CACHE *psc) heap_free(sc); return E_INVALIDARG; } + size = GetOutlineTextMetricsW(hdc, 0, NULL); + if (size) + { + sc->otm = heap_alloc(size); + sc->otm->otmSize = size; + GetOutlineTextMetricsW(hdc, size, sc->otm); + } if (!GetObjectW(GetCurrentObject(hdc, OBJ_FONT), sizeof(LOGFONTW), &sc->lf)) { heap_free(sc); @@ -998,6 +1006,7 @@ HRESULT WINAPI ScriptFreeCache(SCRIPT_CACHE *psc) heap_free(((ScriptCache *)*psc)->scripts[i].languages); } heap_free(((ScriptCache *)*psc)->scripts); + heap_free(((ScriptCache *)*psc)->otm); heap_free(*psc); *psc = NULL; } diff --git a/dlls/usp10/usp10_internal.h b/dlls/usp10/usp10_internal.h index 15553eb25dc..674db8954dd 100644 --- a/dlls/usp10/usp10_internal.h +++ b/dlls/usp10/usp10_internal.h @@ -159,6 +159,7 @@ typedef struct { typedef struct { LOGFONTW lf; TEXTMETRICW tm; + OUTLINETEXTMETRICW *otm; BOOL sfnt; CacheGlyphPage *page[0x10]; ABC *widths[GLYPH_MAX / GLYPH_BLOCK_SIZE];