Do not mix up font dirs into the list of config dirs

This commit is contained in:
Akira TAGOH 2018-02-05 12:47:01 +09:00
parent 5710377301
commit 34b5c949d5
5 changed files with 7 additions and 16 deletions

View File

@ -383,7 +383,7 @@ main (int argc, char **argv)
FcStrSetDestroy (dirs); FcStrSetDestroy (dirs);
} }
else else
list = FcConfigGetConfigDirs (config); list = FcConfigGetFontDirs (config);
if ((processed_dirs = FcStrSetCreate()) == NULL) { if ((processed_dirs = FcStrSetCreate()) == NULL) {
fprintf(stderr, _("Out of Memory\n")); fprintf(stderr, _("Out of Memory\n"));

View File

@ -520,14 +520,6 @@ FcConfigAddFontDir (FcConfig *config,
return FcStrSetAddFilename (config->fontDirs, d); return FcStrSetAddFilename (config->fontDirs, d);
} }
FcBool
FcConfigAddDir (FcConfig *config,
const FcChar8 *d)
{
return (FcConfigAddConfigDir (config, d) &&
FcConfigAddFontDir (config, d));
}
FcStrList * FcStrList *
FcConfigGetFontDirs (FcConfig *config) FcConfigGetFontDirs (FcConfig *config)
{ {

View File

@ -44,7 +44,7 @@ FcInitFallbackConfig (const FcChar8 *sysroot)
if (!config) if (!config)
goto bail0; goto bail0;
FcConfigSetSysRoot (config, sysroot); FcConfigSetSysRoot (config, sysroot);
if (!FcConfigAddDir (config, (FcChar8 *) FC_DEFAULT_FONTS)) if (!FcConfigAddFontDir (config, (FcChar8 *) FC_DEFAULT_FONTS))
goto bail1; goto bail1;
if (!FcConfigAddCacheDir (config, (FcChar8 *) FC_CACHEDIR)) if (!FcConfigAddCacheDir (config, (FcChar8 *) FC_CACHEDIR))
goto bail1; goto bail1;

View File

@ -658,10 +658,6 @@ FcPrivate FcBool
FcConfigAddFontDir (FcConfig *config, FcConfigAddFontDir (FcConfig *config,
const FcChar8 *d); const FcChar8 *d);
FcPrivate FcBool
FcConfigAddDir (FcConfig *config,
const FcChar8 *d);
FcPrivate FcBool FcPrivate FcBool
FcConfigAddCacheDir (FcConfig *config, FcConfigAddCacheDir (FcConfig *config,
const FcChar8 *d); const FcChar8 *d);

View File

@ -2156,7 +2156,7 @@ FcParseDir (FcConfigParse *parse)
FcConfigMessage (parse, FcSevereWarning, "empty font directory name ignored"); FcConfigMessage (parse, FcSevereWarning, "empty font directory name ignored");
else if (!parse->scanOnly && (!FcStrUsesHome (data) || FcConfigHome ())) else if (!parse->scanOnly && (!FcStrUsesHome (data) || FcConfigHome ()))
{ {
if (!FcConfigAddDir (parse->config, data)) if (!FcConfigAddFontDir (parse->config, data))
FcConfigMessage (parse, FcSevereError, "out of memory; cannot add directory %s", data); FcConfigMessage (parse, FcSevereError, "out of memory; cannot add directory %s", data);
} }
FcStrBufDestroy (&parse->pstack->str); FcStrBufDestroy (&parse->pstack->str);
@ -3207,6 +3207,9 @@ FcConfigParseAndLoadDir (FcConfig *config,
if (FcDebug () & FC_DBG_CONFIG) if (FcDebug () & FC_DBG_CONFIG)
printf ("\tScanning config dir %s\n", dir); printf ("\tScanning config dir %s\n", dir);
if (load)
FcConfigAddConfigDir (config, dir);
while (ret && (e = readdir (d))) while (ret && (e = readdir (d)))
{ {
int d_len; int d_len;