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);
}
else
list = FcConfigGetConfigDirs (config);
list = FcConfigGetFontDirs (config);
if ((processed_dirs = FcStrSetCreate()) == NULL) {
fprintf(stderr, _("Out of Memory\n"));

View File

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

View File

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

View File

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

View File

@ -2156,7 +2156,7 @@ FcParseDir (FcConfigParse *parse)
FcConfigMessage (parse, FcSevereWarning, "empty font directory name ignored");
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);
}
FcStrBufDestroy (&parse->pstack->str);
@ -3206,7 +3206,10 @@ FcConfigParseAndLoadDir (FcConfig *config,
if (FcDebug () & FC_DBG_CONFIG)
printf ("\tScanning config dir %s\n", dir);
if (load)
FcConfigAddConfigDir (config, dir);
while (ret && (e = readdir (d)))
{
int d_len;