Commit ef5daa9a authored by Aric Stewart's avatar Aric Stewart Committed by Alexandre Julliard

usp10: Cache OUTLINETEXTMETRICW in addition to TEXTMETRICW.

parent 552db7aa
......@@ -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;
}
......
......@@ -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];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment