Akihiro Sagawa : usp10: Fix advance width when glyph is missing.
Alexandre Julliard
julliard at winehq.org
Mon Nov 25 09:12:24 CST 2019
Module: wine
Branch: stable
Commit: 12fb7e9a75f5f9080936def76c362b207e3a974d
URL: https://source.winehq.org/git/wine.git/?a=commit;h=12fb7e9a75f5f9080936def76c362b207e3a974d
Author: Akihiro Sagawa <sagawa.aki at gmail.com>
Date: Thu Jun 13 23:50:25 2019 +0900
usp10: Fix advance width when glyph is missing.
This fixes a regression introduced by 8d018d8d1dadf9d731690567b9c98d5a9eae37db.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47327
Signed-off-by: Akihiro Sagawa <sagawa.aki at gmail.com>
Signed-off-by: Aric Stewart <aric at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit ac0c1d41d1773f5029cc73ae9bd4cfb2ef358b80)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
---
dlls/usp10/tests/usp10.c | 4 ++--
dlls/usp10/usp10.c | 20 +++++++++++++++++++-
2 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/dlls/usp10/tests/usp10.c b/dlls/usp10/tests/usp10.c
index cfd481937a..0ff88f06c7 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 0a269961b7..4e62193669 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)
More information about the wine-cvs
mailing list