usp10: Set fNoGlyphIndex only if the fonts has no opentype/truetype tables.
authorAric Stewart <aric@codeweavers.com>
Wed, 14 Sep 2011 13:53:05 +0000 (08:53 -0500)
committerAlexandre Julliard <julliard@winehq.org>
Wed, 14 Sep 2011 15:00:19 +0000 (17:00 +0200)
dlls/usp10/usp10.c
dlls/usp10/usp10_internal.h

index 9095fe3de78979a1fcfb21fddb3564ea0135fa59..fe8f6a80967bea326663b05ff6ef347b1b49cf91 100644 (file)
@@ -427,6 +427,7 @@ static HRESULT init_script_cache(const HDC hdc, SCRIPT_CACHE *psc)
         heap_free(sc);
         return E_INVALIDARG;
     }
+    sc->sfnt = (GetFontData(hdc, MS_MAKE_TAG('h','e','a','d'), 0, NULL, 0)!=GDI_ERROR);
     *psc = sc;
     TRACE("<- %p\n", sc);
     return S_OK;
@@ -1747,11 +1748,8 @@ HRESULT WINAPI ScriptShapeOpenType( HDC hdc, SCRIPT_CACHE *psc,
     ((ScriptCache *)*psc)->userScript = tagScript;
     ((ScriptCache *)*psc)->userLang = tagLangSys;
 
-    /* set fNoGlyphIndex for symbolic, and device fonts or non truetype fonts */
-    if (!psa->fNoGlyphIndex &&
-        (!(get_cache_pitch_family(psc) & TMPF_TRUETYPE) ||
-         (get_cache_pitch_family(psc) & TMPF_DEVICE) ||
-         (((ScriptCache *)*psc)->tm.tmCharSet == SYMBOL_CHARSET)))
+    /* set fNoGlyphIndex non truetype/opentype fonts */
+    if (!psa->fNoGlyphIndex && !((ScriptCache *)*psc)->sfnt)
         psa->fNoGlyphIndex = TRUE;
 
     /* Initialize a SCRIPT_VISATTR and LogClust for each char in this run */
index 09ffc6574e61132eb591c3573edb63ae46c93a36..e85afbeaac11a4551e6cc96625f318cb9c4e0855 100644 (file)
@@ -85,6 +85,7 @@ typedef struct {
 typedef struct {
     LOGFONTW lf;
     TEXTMETRICW tm;
+    BOOL sfnt;
     WORD *glyphs[GLYPH_MAX / GLYPH_BLOCK_SIZE];
     ABC *widths[GLYPH_MAX / GLYPH_BLOCK_SIZE];
     LPVOID GSUB_Table;