font = FcFreeTypeQuery (file, id, blanks, &count);
if (FcDebug () & FC_DBG_SCAN)
printf ("done\n");
+
+ /*
+ * Edit pattern with user-defined rules
+ */
+ if (font && config && !FcConfigSubstituteWithPat (config, font, NULL, FcMatchScan))
+ {
+ FcPatternDestroy (font);
+ font = NULL;
+ ret = FcFalse;
+ }
+
/*
* Add the font
*/
if (font && (!config || FcConfigAcceptFont (config, font)))
{
+ if (FcDebug() & FC_DBG_SCANV)
+ {
+ printf ("Final font pattern:\n");
+ FcPatternPrint (font);
+ }
if (!FcFontSetAdd (set, font))
{
FcPatternDestroy (font);
- font = 0;
+ font = NULL;
ret = FcFalse;
}
}
int i;
FcBlanks *blanks = FcConfigGetBlanks (config);
FcCache *cache = NULL;
+ struct stat dir_stat;
if (FcDebug () & FC_DBG_FONTSET)
printf ("cache scan dir %s\n", dir);
ret = FcFalse;
goto bail_1;
}
+ if (stat ((char *) dir, &dir_stat) < 0)
+ {
+ ret = FcFalse;
+ goto bail_1;
+ }
set = FcFontSetCreate();
if (!set)
/*
* Build the cache object
*/
- cache = FcDirCacheBuild (set, dir, dirs);
+ cache = FcDirCacheBuild (set, dir, &dir_stat, dirs);
if (!cache)
goto bail3;
FcDirCacheRead (const FcChar8 *dir, FcBool force, FcConfig *config)
{
FcCache *cache = NULL;
- FcChar8 *canon_dir;
- canon_dir = FcStrCanonFilename (dir);
- if (!canon_dir) canon_dir = (FcChar8 *) dir;
-
- if (config && !FcConfigAcceptFilename (config, canon_dir)) {
- goto bail;
- }
+ if (config && !FcConfigAcceptFilename (config, dir))
+ return NULL;
/* Try to use existing cache file */
if (!force)
- cache = FcDirCacheLoad (canon_dir, config, NULL);
+ cache = FcDirCacheLoad (dir, config, NULL);
/* Not using existing cache file, construct new cache */
if (!cache)
- cache = FcDirCacheScan (canon_dir, config);
-
-bail:
- if (canon_dir != dir)
- free (canon_dir);
+ cache = FcDirCacheScan (dir, config);
return cache;
}
FcBool force,
FcConfig *config)
{
- return FcFalse; /* XXX fixme */
+ return FcFalse; /* XXX deprecated */
}
FcBool
const FcChar8 *dir,
FcBool force)
{
- return FcDirScanConfig (set, dirs, blanks, dir, force, NULL);
+ return FcFalse; /* XXX deprecated */
}
FcBool
{
return FcFalse; /* XXX deprecated */
}
+#define __fcdir__
+#include "fcaliastail.h"
+#undef __fcdir__