Commit 8d018d8d authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

usp10: Make sure metrics cache is used with glyph indices only.

parent d1e618d3
...@@ -3416,35 +3416,41 @@ HRESULT WINAPI ScriptPlaceOpenType( HDC hdc, SCRIPT_CACHE *psc, SCRIPT_ANALYSIS ...@@ -3416,35 +3416,41 @@ HRESULT WINAPI ScriptPlaceOpenType( HDC hdc, SCRIPT_CACHE *psc, SCRIPT_ANALYSIS
if (pABC) memset(pABC, 0, sizeof(ABC)); if (pABC) memset(pABC, 0, sizeof(ABC));
for (i = 0; i < cGlyphs; i++) for (i = 0; i < cGlyphs; i++)
{ {
WORD glyph;
ABC abc; ABC abc;
/* FIXME: set to more reasonable values */
pGoffset[i].du = pGoffset[i].dv = 0;
if (pGlyphProps[i].sva.fZeroWidth) if (pGlyphProps[i].sva.fZeroWidth)
{ {
abc.abcA = abc.abcB = abc.abcC = 0; abc.abcA = abc.abcB = abc.abcC = 0;
if (piAdvance) piAdvance[i] = 0;
continue;
}
if (psa->fNoGlyphIndex)
{
if (FAILED(hr = ScriptGetCMap(hdc, psc, &pwGlyphs[i], 1, 0, &glyph))) return hr;
} }
else if (!get_cache_glyph_widths(psc, pwGlyphs[i], &abc)) else
glyph = pwGlyphs[i];
if (!get_cache_glyph_widths(psc, glyph, &abc))
{ {
BOOL ret;
if (!hdc) return E_PENDING; if (!hdc) return E_PENDING;
if (get_cache_pitch_family(psc) & TMPF_TRUETYPE) if (get_cache_pitch_family(psc) & TMPF_TRUETYPE)
{ {
if (psa->fNoGlyphIndex) if (!GetCharABCWidthsI(hdc, glyph, 1, NULL, &abc)) return S_FALSE;
ret = GetCharABCWidthsW(hdc, pwGlyphs[i], pwGlyphs[i], &abc);
else
ret = GetCharABCWidthsI(hdc, 0, 1, (WORD *)&pwGlyphs[i], &abc);
if (!ret) return S_FALSE;
} }
else else
{ {
INT width; INT width;
if (psa->fNoGlyphIndex) if (!GetCharWidthI(hdc, glyph, 1, NULL, &width)) return S_FALSE;
ret = GetCharWidth32W(hdc, pwGlyphs[i], pwGlyphs[i], &width);
else
ret = GetCharWidthI(hdc, 0, 1, (WORD *)&pwGlyphs[i], &width);
if (!ret) return S_FALSE;
abc.abcB = width; abc.abcB = width;
abc.abcA = abc.abcC = 0; abc.abcA = abc.abcC = 0;
} }
set_cache_glyph_widths(psc, pwGlyphs[i], &abc); set_cache_glyph_widths(psc, glyph, &abc);
} }
if (pABC) if (pABC)
{ {
...@@ -3452,8 +3458,6 @@ HRESULT WINAPI ScriptPlaceOpenType( HDC hdc, SCRIPT_CACHE *psc, SCRIPT_ANALYSIS ...@@ -3452,8 +3458,6 @@ HRESULT WINAPI ScriptPlaceOpenType( HDC hdc, SCRIPT_CACHE *psc, SCRIPT_ANALYSIS
pABC->abcB += abc.abcB; pABC->abcB += abc.abcB;
pABC->abcC += abc.abcC; pABC->abcC += abc.abcC;
} }
/* FIXME: set to more reasonable values */
pGoffset[i].du = pGoffset[i].dv = 0;
if (piAdvance) piAdvance[i] = abc.abcA + abc.abcB + abc.abcC; if (piAdvance) piAdvance[i] = abc.abcA + abc.abcB + abc.abcC;
} }
......
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