diff --git a/dlls/usp10/tests/usp10.c b/dlls/usp10/tests/usp10.c index 270a0f4b195..ecfac4bc5ca 100644 --- a/dlls/usp10/tests/usp10.c +++ b/dlls/usp10/tests/usp10.c @@ -2199,11 +2199,11 @@ static void test_ScriptPlace(HDC hdc) { ok(offset[i].du == 0, "[%d] expected 0, got %d\n", i, offset[i].du); ok(offset[i].dv == 0, "[%d] expected 0, got %d\n", i, offset[i].dv); - todo_wine ok(widths[i] > tm.tmAveCharWidth, "[%d] expected greater than %d, got %d\n", + ok(widths[i] > tm.tmAveCharWidth, "[%d] expected greater than %d, got %d\n", i, tm.tmAveCharWidth, widths[i]); total += widths[i]; } - todo_wine ok(total == sz.cx, "expected %d, got %d\n", sz.cx, total); + ok(total == sz.cx, "expected %d, got %d\n", sz.cx, total); } else skip("Associated font is unavailable\n"); diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c index 6975a49caad..a2e1a735262 100644 --- a/dlls/usp10/usp10.c +++ b/dlls/usp10/usp10.c @@ -3434,9 +3434,27 @@ HRESULT WINAPI ScriptPlaceOpenType( HDC hdc, SCRIPT_CACHE *psc, SCRIPT_ANALYSIS if (FAILED(hr = ScriptGetCMap(hdc, psc, &pwGlyphs[i], 1, 0, &glyph))) return hr; } else + { + hr = S_OK; glyph = pwGlyphs[i]; + } - if (!get_cache_glyph_widths(psc, glyph, &abc)) + if (hr == S_FALSE) + { + if (!hdc) return E_PENDING; + if (get_cache_pitch_family(psc) & TMPF_TRUETYPE) + { + if (!GetCharABCWidthsW(hdc, pwGlyphs[i], pwGlyphs[i], &abc)) return S_FALSE; + } + else + { + INT width; + if (!GetCharWidthW(hdc, pwGlyphs[i], pwGlyphs[i], &width)) return S_FALSE; + abc.abcB = width; + abc.abcA = abc.abcC = 0; + } + } + else if (!get_cache_glyph_widths(psc, glyph, &abc)) { if (!hdc) return E_PENDING; if (get_cache_pitch_family(psc) & TMPF_TRUETYPE)