Nikolay Sivov : usp10: Use single path for all fonts in ScriptGetCMap().

Alexandre Julliard julliard at winehq.org
Mon Feb 25 15:10:34 CST 2019


Module: wine
Branch: master
Commit: df4aaff7a3832c040611e6152b6431ac853371a5
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=df4aaff7a3832c040611e6152b6431ac853371a5

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Fri Feb 22 15:52:48 2019 +0300

usp10: Use single path for all fonts in ScriptGetCMap().

Testing tmPitchAndFamily bitmask does not tell if font has mappings defined.
Besides that, GetGlyphIndices() handles bitmap system fonts exactly the same
way alternate path did.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46678
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Aric Stewart <aric at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/usp10/usp10.c | 45 +++++++++++++++------------------------------
 1 file changed, 15 insertions(+), 30 deletions(-)

diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c
index abc2605..0a26996 100644
--- a/dlls/usp10/usp10.c
+++ b/dlls/usp10/usp10.c
@@ -3544,42 +3544,27 @@ HRESULT WINAPI ScriptGetCMap(HDC hdc, SCRIPT_CACHE *psc, const WCHAR *pwcInChars
 
     hr = S_OK;
 
-    if ((get_cache_pitch_family(psc) & TMPF_TRUETYPE))
+    for (i = 0; i < cChars; i++)
     {
-        for (i = 0; i < cChars; i++)
+        WCHAR inChar;
+        if (dwFlags == SGCM_RTL)
+            inChar = mirror_char(pwcInChars[i]);
+        else
+            inChar = pwcInChars[i];
+        if (!(pwOutGlyphs[i] = get_cache_glyph(psc, inChar)))
         {
-            WCHAR inChar;
-            if (dwFlags == SGCM_RTL)
-                inChar = mirror_char(pwcInChars[i]);
-            else
-                inChar = pwcInChars[i];
-            if (!(pwOutGlyphs[i] = get_cache_glyph(psc, inChar)))
+            WORD glyph;
+            if (!hdc) return E_PENDING;
+            if (GetGlyphIndicesW(hdc, &inChar, 1, &glyph, GGI_MARK_NONEXISTING_GLYPHS) == GDI_ERROR) return S_FALSE;
+            if (glyph == 0xffff)
             {
-                WORD glyph;
-                if (!hdc) return E_PENDING;
-                if (GetGlyphIndicesW(hdc, &inChar, 1, &glyph, GGI_MARK_NONEXISTING_GLYPHS) == GDI_ERROR) return S_FALSE;
-                if (glyph == 0xffff)
-                {
-                    hr = S_FALSE;
-                    glyph = 0x0;
-                }
-                pwOutGlyphs[i] = set_cache_glyph(psc, inChar, glyph);
+                hr = S_FALSE;
+                glyph = 0x0;
             }
+            pwOutGlyphs[i] = set_cache_glyph(psc, inChar, glyph);
         }
     }
-    else
-    {
-        TRACE("no glyph translation\n");
-        for (i = 0; i < cChars; i++)
-        {
-            WCHAR inChar;
-            if (dwFlags == SGCM_RTL)
-                inChar = mirror_char(pwcInChars[i]);
-            else
-                inChar = pwcInChars[i];
-            pwOutGlyphs[i] = inChar;
-        }
-    }
+
     return hr;
 }
 




More information about the wine-cvs mailing list