#define FcPatternElts(p) FcOffsetMember(p,elts_offset,FcPatternElt)
#define FcFontSetFonts(fs) FcPointerMember(fs,fonts,FcPattern *)
-/*
+
#define FcFontSetFont(fs,i) (FcIsEncodedOffset((fs)->fonts) ? \
- FcOffsetToPtr(FcFontSetFonts(fs), \
- FcFontSetFonts(fs)[i]) : \
- fs->fonts[i])*/
+ FcEncodedOffsetToPtr(FcFontSetFonts(fs), \
+ FcFontSetFonts(fs)[i], \
+ FcPattern) : \
+ fs->fonts[i])
typedef enum _FcOp {
FcOpInteger, FcOpDouble, FcOpString, FcOpMatrix, FcOpBool, FcOpCharSet,
typedef struct _FcCache {
int magic; /* FC_CACHE_MAGIC */
- off_t size; /* size of file */
+ intptr_t size; /* size of file */
intptr_t dir; /* offset to dir name */
intptr_t dirs; /* offset to subdirs */
int dirs_count; /* number of subdir strings */
FcChar32 *blanks;
};
+typedef struct _FcCacheList {
+ struct _FcCacheList *next;
+ FcCache *cache;
+} FcCacheList;
+
struct _FcConfig {
/*
* File names loaded from the configuration -- saved here as the
* and those directives may occur in any order
*/
FcStrSet *configDirs; /* directories to scan for fonts */
- FcChar8 *cache; /* name of per-user cache file */
/*
* Set of allowed blank chars -- used to
* trim fonts of bogus glyphs
* match preferrentially
*/
FcFontSet *fonts[FcSetApplication + 1];
+ /*
+ * Font cache information is mapped from cache files
+ * the configuration is destroyed, the files need to be unmapped
+ */
+ FcCacheList *caches;
/*
* Fontconfig can periodically rescan the system configuration
* and font directories. This rescanning occurs when font
FcDirCacheConsume (FILE *file, FcFontSet *set, FcStrSet *dirs,
const FcChar8 *dir, char *dirname);
+void
+FcDirCacheUnmap (FcCache *cache);
+
FcBool
FcDirCacheRead (FcFontSet * set, FcStrSet * dirs, const FcChar8 *dir, FcConfig *config);
+FcCache *
+FcDirCacheMap (const FcChar8 *dir, FcConfig *config, FcChar8 **cache_file);
+
+FcBool
+FcDirCacheLoad (int fd, off_t size, void *closure);
+
+FcBool
+FcDirCacheUnlink (const FcChar8 *dir, FcConfig *config);
+
/* fccfg.c */
FcBool
FcConfigAddConfigFile (FcConfig *config,
const FcChar8 *f);
-FcBool
-FcConfigSetCache (FcConfig *config,
- const FcChar8 *c);
-
FcBool
FcConfigAddBlank (FcConfig *config,
FcChar32 blank);
FcFileTime
FcConfigModifiedTime (FcConfig *config);
+FcBool
+FcConfigAddCache (FcConfig *config, FcCache *cache);
+
+/* fcserialize.c */
intptr_t
FcAlignSize (intptr_t size);
FcBool
FcNameUnparseLangSet (FcStrBuf *buf, const FcLangSet *ls);
+FcChar8 *
+FcNameUnparseEscaped (FcPattern *pat, FcBool escape);
+
/* fclist.c */
FcBool
const char *
FcObjectName (FcObject object);
-#define FcObjectCompare(a, b) ((int) a - (int) b)
+FcBool
+FcObjectInit (void);
void
-FcObjectStaticNameFini (void);
+FcObjectFini (void);
+
+#define FcObjectCompare(a, b) ((int) a - (int) b)
/* fcpat.c */