diff options
author | marha <marha@users.sourceforge.net> | 2014-01-06 17:47:52 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2014-01-06 17:47:52 +0100 |
commit | be6e384aa4b97dc81b88ab5b04328c161828e760 (patch) | |
tree | 3732c29150fc68a256d7c74f13b4b07131aab460 /fontconfig/src | |
parent | 1b37f71714e2ca4af60bd050adbbb7969534dfd6 (diff) | |
download | vcxsrv-be6e384aa4b97dc81b88ab5b04328c161828e760.tar.gz vcxsrv-be6e384aa4b97dc81b88ab5b04328c161828e760.tar.bz2 vcxsrv-be6e384aa4b97dc81b88ab5b04328c161828e760.zip |
randsrproto fontconfig libX11 git update 6 Jan 2014
xserver commit 2ea973e12f5d954211e1d10085a4c74581b43aca
libxcb commit 3b72a2c9d1d656c74c691a45689e1d637f669e3a
libxcb/xcb-proto commit 0d8f09b6469c45be08dae3665d352269ffcc7df2
xkeyboard-config commit 8f49a59f8cd118564ec1554d428177d681bc8b7f
libX11 commit 321392ded15a7ee9d177d4ebe8846336ba76741c
libXdmcp commit 089081dca4ba3598c6f9bf401c029378943b5854
libXext commit bb24f2970f2e425f4df90c9b73d078ad15a73fbb
libfontenc commit 3acba630d8b57084f7e92c15732408711ed5137a
libXinerama commit edd95182b26eb5d576d4878c559e0f17dddaa909
libXau commit 1e4635be11154dd8262f37b379511bd627defa2a
xkbcomp commit e3e6e938535532bfad175c1635256ab7fb3ac943
pixman commit 82d094654a46bd97d47f1f132a01ae0a74b986f3
xextproto commit 66afec3f49e8eb0d4c2e9af7088fc3116d4bafd7
randrproto commit 4d8e809684dedb970001099076bb62a38fcd82ca
glproto commit f84853d97d5749308992412a215fa518b6536eb3
mkfontscale commit eac564e0fc9052a39981ea47b271f7f3d2821944
xwininfo commit ba0d1b0da21d2dbdd81098ed5778f3792b472e13
libXft commit 4acfdaf95adb0a05c2a25550bdde036c865902f4
libXmu commit 22d9c590901e121936f50dee97dc60c4f7defb63
libxtrans commit 2c0a7840a28ae696e80e73157856d7a049fdf6c7
fontconfig commit 7a6622f25cdfab5ab775324bef1833b67109801b
mesa commit a61ae2aa01c9b1976ba4107c1564e0c3f94aea4d
Diffstat (limited to 'fontconfig/src')
-rw-r--r-- | fontconfig/src/fccache.c | 13 | ||||
-rw-r--r-- | fontconfig/src/fcdir.c | 46 | ||||
-rw-r--r-- | fontconfig/src/fcfs.c | 22 | ||||
-rw-r--r-- | fontconfig/src/fcint.h | 6 | ||||
-rw-r--r-- | fontconfig/src/fcpat.c | 2 |
5 files changed, 88 insertions, 1 deletions
diff --git a/fontconfig/src/fccache.c b/fontconfig/src/fccache.c index 10eacffdf..5173e0be2 100644 --- a/fontconfig/src/fccache.c +++ b/fontconfig/src/fccache.c @@ -828,6 +828,19 @@ bail1: return NULL; } +FcCache * +FcDirCacheRebuild (FcCache *cache, struct stat *dir_stat, FcStrSet *dirs) +{ + FcCache *new; + FcFontSet *set = FcFontSetDeserialize (FcCacheSet (cache)); + const FcChar8 *dir = FcCacheDir (cache); + + new = FcDirCacheBuild (set, dir, dir_stat, dirs); + FcFontSetDestroy (set); + + return new; +} + /* write serialized state to the cache file */ FcBool FcDirCacheWrite (FcCache *cache, FcConfig *config) diff --git a/fontconfig/src/fcdir.c b/fontconfig/src/fcdir.c index b040a285a..3bcd0b867 100644 --- a/fontconfig/src/fcdir.c +++ b/fontconfig/src/fcdir.c @@ -130,7 +130,12 @@ FcFileScanConfig (FcFontSet *set, if (FcFileIsDir (file)) return FcStrSetAdd (dirs, file); else - return FcFileScanFontConfig (set, blanks, file, config); + { + if (set) + return FcFileScanFontConfig (set, blanks, file, config); + else + return FcTrue; + } } FcBool @@ -306,6 +311,45 @@ FcDirCacheScan (const FcChar8 *dir, FcConfig *config) return cache; } +FcCache * +FcDirCacheRescan (const FcChar8 *dir, FcConfig *config) +{ + FcCache *cache = FcDirCacheLoad (dir, config, NULL); + FcCache *new = NULL; + struct stat dir_stat; + FcStrSet *dirs; + + if (!cache) + return NULL; + if (FcStatChecksum (dir, &dir_stat) < 0) + goto bail; + dirs = FcStrSetCreate (); + if (!dirs) + goto bail; + + /* + * Scan the dir + */ + if (!FcDirScanConfig (NULL, dirs, NULL, dir, FcTrue, config)) + goto bail1; + /* + * Rebuild the cache object + */ + new = FcDirCacheRebuild (cache, &dir_stat, dirs); + if (!new) + goto bail1; + FcDirCacheUnload (cache); + /* + * Write out the cache file, ignoring any troubles + */ + FcDirCacheWrite (new, config); + +bail1: + FcStrSetDestroy (dirs); +bail: + return new; +} + /* * Read (or construct) the cache for a directory */ diff --git a/fontconfig/src/fcfs.c b/fontconfig/src/fcfs.c index 941abba8f..21c6c7cbb 100644 --- a/fontconfig/src/fcfs.c +++ b/fontconfig/src/fcfs.c @@ -122,6 +122,28 @@ FcFontSetSerialize (FcSerialize *serialize, const FcFontSet * s) return s_serialize; } + +FcFontSet * +FcFontSetDeserialize (const FcFontSet *set) +{ + int i; + FcFontSet *new = FcFontSetCreate (); + + if (!new) + return NULL; + for (i = 0; i < set->nfont; i++) + { + if (!FcFontSetAdd (new, FcPatternDuplicate (FcFontSetFont (set, i)))) + goto bail; + } + + return new; +bail: + FcFontSetDestroy (new); + + return NULL; +} + #define __fcfs__ #include "fcaliastail.h" #undef __fcfs__ diff --git a/fontconfig/src/fcint.h b/fontconfig/src/fcint.h index 362ea6f99..cdf2daba0 100644 --- a/fontconfig/src/fcint.h +++ b/fontconfig/src/fcint.h @@ -567,6 +567,9 @@ FcDirCacheScan (const FcChar8 *dir, FcConfig *config); FcPrivate FcCache * FcDirCacheBuild (FcFontSet *set, const FcChar8 *dir, struct stat *dir_stat, FcStrSet *dirs); +FcPrivate FcCache * +FcDirCacheRebuild (FcCache *cache, struct stat *dir_stat, FcStrSet *dirs); + FcPrivate FcBool FcDirCacheWrite (FcCache *cache, FcConfig *config); @@ -838,6 +841,9 @@ FcFontSetSerializeAlloc (FcSerialize *serialize, const FcFontSet *s); FcPrivate FcFontSet * FcFontSetSerialize (FcSerialize *serialize, const FcFontSet * s); +FcPrivate FcFontSet * +FcFontSetDeserialize (const FcFontSet *set); + /* fchash.c */ FcPrivate FcChar8 * FcHashGetSHA256Digest (const FcChar8 *input_strings, diff --git a/fontconfig/src/fcpat.c b/fontconfig/src/fcpat.c index 0614ac2c2..986cca391 100644 --- a/fontconfig/src/fcpat.c +++ b/fontconfig/src/fcpat.c @@ -33,6 +33,7 @@ FcPatternCreate (void) p = (FcPattern *) malloc (sizeof (FcPattern)); if (!p) return 0; + memset (p, 0, sizeof (FcPattern)); p->num = 0; p->size = 0; p->elts_offset = FcPtrToOffset (p, NULL); @@ -1310,6 +1311,7 @@ FcValueListSerialize (FcSerialize *serialize, const FcValueList *vl) } return head_serialized; } + #define __fcpat__ #include "fcaliastail.h" #include "fcftaliastail.h" |