diff options
author | marha <marha@users.sourceforge.net> | 2013-08-19 09:03:18 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2013-08-19 09:03:18 +0200 |
commit | 854ec4da20ddff9b830be0a7d5b81d8cb4774132 (patch) | |
tree | 223425d84b5ea3727f74546c92dee8b03c074158 /fontconfig/src | |
parent | 0659c77949b38440a2a9ba67e1ee9cacef1f3a7f (diff) | |
download | vcxsrv-854ec4da20ddff9b830be0a7d5b81d8cb4774132.tar.gz vcxsrv-854ec4da20ddff9b830be0a7d5b81d8cb4774132.tar.bz2 vcxsrv-854ec4da20ddff9b830be0a7d5b81d8cb4774132.zip |
fontconfig libX11 libXdmcp libxcb xkeyboard-config mesa pixman xserver git update 19 aug 2013
xserver commit fe7463b8ce0de301c2f82b108c93963424f77219
libxcb commit 5648ddd2b97068f549268284129a438a6845e14c
libxcb/xcb-proto commit 56a82005ac388fcb7a4d1c82e07c7e72eaf69a32
xkeyboard-config commit 87c865aee1844b2cc6b1a5a208116dd095f4d76a
libX11 commit 9b291044a240e5b9b031ed814e0c84e53a1c3084
libXdmcp commit 66514a4af7eaa47e8718434356d7efce95e570cf
libXext commit 7378d4bdbd33ed49ed6cfa5c4f73d7527982aab4
libfontenc commit 3acba630d8b57084f7e92c15732408711ed5137a
libXinerama commit 6e1d1dc328ba8162bba2f4694e7f3c706a1491ff
libXau commit 899790011304c4029e15abf410e49ce7cec17e0a
xkbcomp commit 0ebdf47fd4bc434ac3d2339544c022a869510738
pixman commit 3518a0dafa63098d41e466f73d105b7e3e4b12de
xextproto commit f27fcc99d1cf935cc289933326f7d3baacd5107a
randrproto commit ca7cc541c2e43e6c784df19b4583ac35829d2f72
glproto commit 8e3407e02980d088e20041e79bdcdd3737e7827e
mkfontscale commit f48de13423c7300f4da9f61993b624426b38ddc0
xwininfo commit ba0d1b0da21d2dbdd81098ed5778f3792b472e13
libXft commit c5e760a239afc62a1c75e0509868e35957c8df52
libXmu commit d5dac08d65c4865f311cb62c161dbb1300eecd11
libxtrans commit f6a161f2a003f4da0a2e414b4faa0ee0de0c01f0
fontconfig commit 084cf7c44e985dd48c088d921ad0d9a43b0b00b4
mesa commit d13003f544417db6de44c65a0c118bd2b189458a
Diffstat (limited to 'fontconfig/src')
-rw-r--r-- | fontconfig/src/fccache.c | 28 | ||||
-rw-r--r-- | fontconfig/src/fccfg.c | 102 | ||||
-rw-r--r-- | fontconfig/src/fccompat.c | 27 | ||||
-rw-r--r-- | fontconfig/src/fcdir.c | 10 | ||||
-rw-r--r-- | fontconfig/src/fcint.h | 11 | ||||
-rw-r--r-- | fontconfig/src/fcmatch.c | 2 | ||||
-rw-r--r-- | fontconfig/src/fcobjs.c | 2 | ||||
-rw-r--r-- | fontconfig/src/fcobjs.h | 4 | ||||
-rw-r--r-- | fontconfig/src/fcxml.c | 59 |
9 files changed, 178 insertions, 67 deletions
diff --git a/fontconfig/src/fccache.c b/fontconfig/src/fccache.c index 9f1c29827..e02d49e8f 100644 --- a/fontconfig/src/fccache.c +++ b/fontconfig/src/fccache.c @@ -830,34 +830,6 @@ bail1: return NULL; } - -#ifdef _WIN32 -#include <direct.h> -#define mkdir(path,mode) _mkdir(path) -#endif - -static FcBool -FcMakeDirectory (const FcChar8 *dir) -{ - FcChar8 *parent; - FcBool ret; - - if (strlen ((char *) dir) == 0) - return FcFalse; - - parent = FcStrDirname (dir); - if (!parent) - return FcFalse; - if (access ((char *) parent, F_OK) == 0) - ret = mkdir ((char *) dir, 0755) == 0 && chmod ((char *) dir, 0755) == 0; - else if (access ((char *) parent, F_OK) == -1) - ret = FcMakeDirectory (parent) && (mkdir ((char *) dir, 0755) == 0) && chmod ((char *) dir, 0755) == 0; - else - ret = FcFalse; - FcStrFree (parent); - return ret; -} - /* write serialized state to the cache file */ FcBool FcDirCacheWrite (FcCache *cache, FcConfig *config) diff --git a/fontconfig/src/fccfg.c b/fontconfig/src/fccfg.c index 7ea94b846..be738d53d 100644 --- a/fontconfig/src/fccfg.c +++ b/fontconfig/src/fccfg.c @@ -674,12 +674,21 @@ FcConfigAddRule (FcConfig *config, num = 0; for (r = rule; r; r = r->next) { - if (r->type == FcRuleTest) + switch (r->type) { + case FcRuleTest: if (r->u.test && r->u.test->kind == FcMatchDefault) r->u.test->kind = kind; - num++; + if (r->u.test->object > FC_MAX_BASE_OBJECT) + num++; + break; + case FcRuleEdit: + if (r->u.edit->object > FC_MAX_BASE_OBJECT) + num++; + break; + default: + break; } } if (config->maxObjects < num) @@ -1486,11 +1495,15 @@ FcConfigSubstituteWithPat (FcConfig *config, FcValue v; FcSubst *s; FcRule *r; - FcValueList *l, *value = NULL; + FcValueList *l, **value = NULL; FcPattern *m; FcStrSet *strs; - FcPatternElt *elt = NULL; FcObject object = FC_INVALID_OBJECT; + FcPatternElt **elt = NULL; + int i, nobjs; + FcBool retval = FcTrue; + +#define FC_OBJ_ID(_n_) ((_n_) > FC_MAX_BASE_OBJECT ? ((_n_) - FC_EXT_OBJ_INDEX) : (_n_)) if (!config) { @@ -1535,6 +1548,20 @@ FcConfigSubstituteWithPat (FcConfig *config, return FcFalse; } + nobjs = FC_MAX_BASE_OBJECT + config->maxObjects + 2; + value = (FcValueList **) malloc (SIZEOF_VOID_P * nobjs); + if (!value) + { + retval = FcFalse; + goto bail1; + } + elt = (FcPatternElt **) malloc (SIZEOF_VOID_P * nobjs); + if (!elt) + { + retval = FcFalse; + goto bail1; + } + if (FcDebug () & FC_DBG_EDIT) { printf ("FcConfigSubstitute "); @@ -1543,6 +1570,11 @@ FcConfigSubstituteWithPat (FcConfig *config, for (; s; s = s->next) { r = s->rule; + for (i = 0; i < nobjs; i++) + { + elt[i] = NULL; + value[i] = NULL; + } for (; r; r = r->next) { switch (r->type) { @@ -1550,6 +1582,7 @@ FcConfigSubstituteWithPat (FcConfig *config, /* shouldn't be reached */ break; case FcRuleTest: + object = FC_OBJ_ID (r->u.test->object); /* * Check the tests to see if * they all match the pattern @@ -1564,18 +1597,16 @@ FcConfigSubstituteWithPat (FcConfig *config, else m = p; if (m) - elt = FcPatternObjectFindElt (m, r->u.test->object); - else - elt = NULL; + elt[object] = FcPatternObjectFindElt (m, r->u.test->object); /* * If there's no such field in the font, * then FcQualAll matches while FcQualAny does not */ - if (!elt) + if (!elt[object]) { if (r->u.test->qual == FcQualAll) { - value = NULL; + value[object] = NULL; continue; } else @@ -1589,18 +1620,18 @@ FcConfigSubstituteWithPat (FcConfig *config, * Check to see if there is a match, mark the location * to apply match-relative edits */ - value = FcConfigMatchValueList (m, p_pat, kind, r->u.test, elt->values); - if (!value || - (r->u.test->qual == FcQualFirst && value != elt->values) || - (r->u.test->qual == FcQualNotFirst && value == elt->values)) + value[object] = FcConfigMatchValueList (m, p_pat, kind, r->u.test, elt[object]->values); + if (!value[object] || + (r->u.test->qual == FcQualFirst && value[object] != elt[object]->values) || + (r->u.test->qual == FcQualNotFirst && value[object] == elt[object]->values)) { if (FcDebug () & FC_DBG_EDIT) printf ("No match\n"); goto bail; } - object = r->u.test->object; break; case FcRuleEdit: + object = FC_OBJ_ID (r->u.edit->object); if (FcDebug () & FC_DBG_EDIT) { printf ("Substitute "); @@ -1611,13 +1642,6 @@ FcConfigSubstituteWithPat (FcConfig *config, * Evaluate the list of expressions */ l = FcConfigValues (p, p_pat,kind, r->u.edit->expr, r->u.edit->binding); - /* - * Locate any test associated with this field, skipping - * tests associated with the pattern when substituting in - * the font - */ - if (object != r->u.edit->object) - value = NULL; switch (FC_OP_GET_OP (r->u.edit->op)) { case FcOpAssign: @@ -1625,25 +1649,25 @@ FcConfigSubstituteWithPat (FcConfig *config, * If there was a test, then replace the matched * value with the new list of values */ - if (value) + if (value[object]) { - FcValueList *thisValue = value; - FcValueList *nextValue = thisValue; + FcValueList *thisValue = value[object]; + FcValueList *nextValue = l; /* * Append the new list of values after the current value */ - FcConfigAdd (&elt->values, thisValue, FcTrue, l, r->u.edit->object); + FcConfigAdd (&elt[object]->values, thisValue, FcTrue, l, r->u.edit->object); /* * Delete the marked value */ if (thisValue) - FcConfigDel (&elt->values, thisValue); + FcConfigDel (&elt[object]->values, thisValue); /* * Adjust a pointer into the value list to ensure * future edits occur at the same place */ - value = nextValue; + value[object] = nextValue; break; } /* fall through ... */ @@ -1658,12 +1682,12 @@ FcConfigSubstituteWithPat (FcConfig *config, * Adjust a pointer into the value list as they no * longer point to anything valid */ - value = NULL; + value[object] = NULL; break; case FcOpPrepend: - if (value) + if (value[object]) { - FcConfigAdd (&elt->values, value, FcFalse, l, r->u.edit->object); + FcConfigAdd (&elt[object]->values, value[object], FcFalse, l, r->u.edit->object); break; } /* fall through ... */ @@ -1671,9 +1695,9 @@ FcConfigSubstituteWithPat (FcConfig *config, FcConfigPatternAdd (p, r->u.edit->object, l, FcFalse); break; case FcOpAppend: - if (value) + if (value[object]) { - FcConfigAdd (&elt->values, value, FcTrue, l, r->u.edit->object); + FcConfigAdd (&elt[object]->values, value[object], FcTrue, l, r->u.edit->object); break; } /* fall through ... */ @@ -1681,9 +1705,9 @@ FcConfigSubstituteWithPat (FcConfig *config, FcConfigPatternAdd (p, r->u.edit->object, l, FcTrue); break; case FcOpDelete: - if (value) + if (value[object]) { - FcConfigDel (&elt->values, value); + FcConfigDel (&elt[object]->values, value[object]); break; } /* fall through ... */ @@ -1715,7 +1739,15 @@ FcConfigSubstituteWithPat (FcConfig *config, printf ("FcConfigSubstitute done"); FcPatternPrint (p); } - return FcTrue; +bail1: + if (elt) + free (elt); + if (value) + free (value); + +#undef FC_OBJ_ID + + return retval; } FcBool diff --git a/fontconfig/src/fccompat.c b/fontconfig/src/fccompat.c index a2171607c..d4f88c83f 100644 --- a/fontconfig/src/fccompat.c +++ b/fontconfig/src/fccompat.c @@ -219,3 +219,30 @@ FcRandom(void) return result; } + +#ifdef _WIN32 +#include <direct.h> +#define mkdir(path,mode) _mkdir(path) +#endif + +FcBool +FcMakeDirectory (const FcChar8 *dir) +{ + FcChar8 *parent; + FcBool ret; + + if (strlen ((char *) dir) == 0) + return FcFalse; + + parent = FcStrDirname (dir); + if (!parent) + return FcFalse; + if (access ((char *) parent, F_OK) == 0) + ret = mkdir ((char *) dir, 0755) == 0 && chmod ((char *) dir, 0755) == 0; + else if (access ((char *) parent, F_OK) == -1) + ret = FcMakeDirectory (parent) && (mkdir ((char *) dir, 0755) == 0) && chmod ((char *) dir, 0755) == 0; + else + ret = FcFalse; + FcStrFree (parent); + return ret; +} diff --git a/fontconfig/src/fcdir.c b/fontconfig/src/fcdir.c index dc580bb6f..b040a285a 100644 --- a/fontconfig/src/fcdir.c +++ b/fontconfig/src/fcdir.c @@ -49,6 +49,16 @@ FcFileIsLink (const FcChar8 *file) #endif } +FcBool +FcFileIsFile (const FcChar8 *file) +{ + struct stat statb; + + if (FcStat (file, &statb) != 0) + return FcFalse; + return S_ISREG (statb.st_mode); +} + static FcBool FcFileScanFontConfig (FcFontSet *set, FcBlanks *blanks, diff --git a/fontconfig/src/fcint.h b/fontconfig/src/fcint.h index fe523fb7c..ec0c67470 100644 --- a/fontconfig/src/fcint.h +++ b/fontconfig/src/fcint.h @@ -174,6 +174,11 @@ typedef struct _FcValueList { typedef int FcObject; +/* The 1000 is to leave some room for future added internal objects, such + * that caches from newer fontconfig can still be used with older fontconfig + * without getting confused. */ +#define FC_EXT_OBJ_INDEX 1000 + typedef struct _FcPatternElt *FcPatternEltPtr; /* @@ -742,6 +747,9 @@ FcMakeTempfile (char *template); FcPrivate int32_t FcRandom (void); +FcPrivate FcBool +FcMakeDirectory (const FcChar8 *dir); + /* fcdbg.c */ FcPrivate void @@ -800,6 +808,9 @@ FcPrivate FcBool FcFileIsLink (const FcChar8 *file); FcPrivate FcBool +FcFileIsFile (const FcChar8 *file); + +FcPrivate FcBool FcFileScanConfig (FcFontSet *set, FcStrSet *dirs, FcBlanks *blanks, diff --git a/fontconfig/src/fcmatch.c b/fontconfig/src/fcmatch.c index 10976d6e8..dec92b9cf 100644 --- a/fontconfig/src/fcmatch.c +++ b/fontconfig/src/fcmatch.c @@ -245,6 +245,8 @@ typedef enum _FcMatcherPriorityDummy { typedef enum _FcMatcherPriority { PRI1(HASH), PRI1(FILE), + PRI1(FONTFORMAT), + PRI1(SCALABLE), PRI1(FOUNDRY), PRI1(CHARSET), PRI_FAMILY_STRONG, diff --git a/fontconfig/src/fcobjs.c b/fontconfig/src/fcobjs.c index 1d3af73be..bad9824d4 100644 --- a/fontconfig/src/fcobjs.c +++ b/fontconfig/src/fcobjs.c @@ -37,7 +37,7 @@ FcObjectTypeLookup (register const char *str, register unsigned int len); /* The 1000 is to leave some room for future added internal objects, such * that caches from newer fontconfig can still be used with older fontconfig * without getting confused. */ -static fc_atomic_int_t next_id = FC_MAX_BASE_OBJECT + 1000; +static fc_atomic_int_t next_id = FC_MAX_BASE_OBJECT + FC_EXT_OBJ_INDEX; struct FcObjectOtherTypeInfo { struct FcObjectOtherTypeInfo *next; FcObjectType object; diff --git a/fontconfig/src/fcobjs.h b/fontconfig/src/fcobjs.h index 682fe6ad3..87c7319e3 100644 --- a/fontconfig/src/fcobjs.h +++ b/fontconfig/src/fcobjs.h @@ -23,7 +23,7 @@ FC_OBJECT (FILE, FcTypeString, FcCompareFilename) FC_OBJECT (INDEX, FcTypeInteger, NULL) FC_OBJECT (RASTERIZER, FcTypeString, FcCompareString) FC_OBJECT (OUTLINE, FcTypeBool, FcCompareBool) -FC_OBJECT (SCALABLE, FcTypeBool, NULL) +FC_OBJECT (SCALABLE, FcTypeBool, FcCompareBool) FC_OBJECT (DPI, FcTypeDouble, NULL) FC_OBJECT (RGBA, FcTypeInteger, NULL) FC_OBJECT (SCALE, FcTypeDouble, NULL) @@ -35,7 +35,7 @@ FC_OBJECT (CHARSET, FcTypeCharSet, FcCompareCharSet) FC_OBJECT (LANG, FcTypeLangSet, FcCompareLang) FC_OBJECT (FONTVERSION, FcTypeInteger, FcCompareNumber) FC_OBJECT (CAPABILITY, FcTypeString, NULL) -FC_OBJECT (FONTFORMAT, FcTypeString, NULL) +FC_OBJECT (FONTFORMAT, FcTypeString, FcCompareString) FC_OBJECT (EMBOLDEN, FcTypeBool, NULL) FC_OBJECT (EMBEDDED_BITMAP, FcTypeBool, NULL) FC_OBJECT (DECORATIVE, FcTypeBool, FcCompareBool) diff --git a/fontconfig/src/fcxml.c b/fontconfig/src/fcxml.c index 6a2af85e3..2cdf0ad0a 100644 --- a/fontconfig/src/fcxml.c +++ b/fontconfig/src/fcxml.c @@ -2182,6 +2182,8 @@ FcParseInclude (FcConfigParse *parse) FcBool ignore_missing = FcFalse; FcBool deprecated = FcFalse; FcChar8 *prefix = NULL, *p; + static FcChar8 *userdir = NULL; + static FcChar8 *userconf = NULL; s = FcStrBufDoneStatic (&parse->pstack->str); if (!s) @@ -2214,23 +2216,78 @@ FcParseInclude (FcConfigParse *parse) memcpy (&prefix[plen + 1], s, dlen); prefix[plen + 1 + dlen] = 0; s = prefix; + if (FcFileIsDir (s)) + { + userdir: + if (!userdir) + userdir = FcStrdup (s); + } + else if (FcFileIsFile (s)) + { + userconf: + if (!userconf) + userconf = FcStrdup (s); + } + else + { + /* No config dir nor file on the XDG directory spec compliant place + * so need to guess what it is supposed to be. + */ + FcChar8 *parent = FcStrDirname (s); + + if (!FcFileIsDir (parent)) + FcMakeDirectory (parent); + FcStrFree (parent); + if (FcStrStr (s, (const FcChar8 *)"conf.d") != NULL) + goto userdir; + else + goto userconf; + } } if (!FcConfigParseAndLoad (parse->config, s, !ignore_missing)) parse->error = FcTrue; +#ifndef _WIN32 else { FcChar8 *filename; + static FcBool warn_conf = FcFalse, warn_confd = FcFalse; filename = FcConfigFilename(s); if (deprecated == FcTrue && filename != NULL && !FcFileIsLink (filename)) { - FcConfigMessage (parse, FcSevereWarning, "reading configurations from %s is deprecated.", s); + if (FcFileIsDir (filename)) + { + if (FcFileIsDir (userdir) || + rename ((const char *)filename, (const char *)userdir) != 0 || + symlink ((const char *)userdir, (const char *)filename) != 0) + { + if (!warn_confd) + { + FcConfigMessage (parse, FcSevereWarning, "reading configurations from %s is deprecated. please move it to %s manually", s, userdir); + warn_confd = FcTrue; + } + } + } + else + { + if (FcFileIsFile (userconf) || + rename ((const char *)filename, (const char *)userconf) != 0 || + symlink ((const char *)userconf, (const char *)filename) != 0) + { + if (!warn_conf) + { + FcConfigMessage (parse, FcSevereWarning, "reading configurations from %s is deprecated. please move it to %s manually", s, userconf); + warn_conf = FcTrue; + } + } + } } if(filename) FcStrFree(filename); } +#endif FcStrBufDestroy (&parse->pstack->str); bail: |