[PATCH 1/4] gdi32: Ignore Type 1 fonts in fontconfig enumeration.

Rémi Bernon rbernon at codeweavers.com
Mon Nov 16 02:56:49 CST 2020


Instead of loading the font with FreeType to discard it right away.

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---

This series brings another ~350ms prefix startup time improvement, with
"wine cmd /c exit" execution time going from ~1.25s to ~0.9s on average.

 dlls/gdi32/freetype.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
index 61397e8b542..7ea96af0a59 100644
--- a/dlls/gdi32/freetype.c
+++ b/dlls/gdi32/freetype.c
@@ -1393,6 +1393,7 @@ static void load_fontconfig_fonts(void)
 {
     FcPattern *pat;
     FcFontSet *fontset;
+    const char *format;
     int i, len;
     char *file;
     const char *ext;
@@ -1428,6 +1429,18 @@ static void load_fontconfig_fonts(void)
             continue;
         }
 
+        if (pFcPatternGetString( fontset->fonts[i], FC_FONTFORMAT, 0, (FcChar8 **)&format ) != FcResultMatch)
+        {
+            TRACE( "ignoring unknown font format %s\n", debugstr_a(file) );
+            continue;
+        }
+
+        if (!strcmp( format, "Type 1" ))
+        {
+            TRACE( "ignoring Type 1 font %s\n", debugstr_a(file) );
+            continue;
+        }
+
         aa_flags = parse_aa_pattern( fontset->fonts[i] );
         TRACE("fontconfig: %s aa %x\n", file, aa_flags);
 
-- 
2.29.2




More information about the wine-devel mailing list