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

Huw Davies huw at codeweavers.com
Fri Nov 20 04:44:15 CST 2020


On Mon, Nov 16, 2020 at 09:56:49AM +0100, Rémi Bernon wrote:
> 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);
>  

I've sent in a new version that removes the pfa/pfb hack as
part of this patch, rather than have it disappear in a
subsequent one.

Thanks,
Huw.



More information about the wine-devel mailing list