gdi32: Ignore Type 1 fonts in fontconfig enumeration.

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

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2020-11-20 10:40:39 +00:00 committed by Alexandre Julliard
parent 0edef50dfa
commit 37c72ce2d6
1 changed files with 16 additions and 12 deletions

View File

@ -1393,9 +1393,9 @@ static void load_fontconfig_fonts(void)
{
FcPattern *pat;
FcFontSet *fontset;
int i, len;
const char *format;
int i;
char *file;
const char *ext;
if (!fontconfig_enabled) return;
@ -1418,25 +1418,29 @@ static void load_fontconfig_fonts(void)
pFcConfigSubstitute( NULL, fontset->fonts[i], FcMatchFont );
/* We're just interested in OT/TT fonts for now, so this hack just
picks up the scalable fonts without extensions .pf[ab] to save time
loading every other font */
if(pFcPatternGetBool(fontset->fonts[i], FC_SCALABLE, 0, &scalable) == FcResultMatch && !scalable)
{
TRACE("not scalable\n");
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);
len = strlen( file );
if(len < 4) continue;
ext = &file[ len - 3 ];
if(_strnicmp(ext, "pfa", -1) && _strnicmp(ext, "pfb", -1))
AddFontToList(NULL, file, NULL, 0,
ADDFONT_EXTERNAL_FONT | ADDFONT_ADD_TO_CACHE | ADDFONT_AA_FLAGS(aa_flags) );
AddFontToList( NULL, file, NULL, 0,
ADDFONT_EXTERNAL_FONT | ADDFONT_ADD_TO_CACHE | ADDFONT_AA_FLAGS(aa_flags) );
}
pFcFontSetDestroy(fontset);
pFcPatternDestroy(pat);