aboutsummaryrefslogtreecommitdiff
path: root/fontconfig/src
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2015-01-04 16:25:32 +0100
committermarha <marha@users.sourceforge.net>2015-01-04 16:25:32 +0100
commit5e5a48ff8cd08f123601cd0625ca62a86675aac9 (patch)
treeea1c2cee139e8e1ce389a7f956e9874db1e0a650 /fontconfig/src
parenta1011d63ffb5cc4f41bf0f4622ee3f1493d419d9 (diff)
downloadvcxsrv-5e5a48ff8cd08f123601cd0625ca62a86675aac9.tar.gz
vcxsrv-5e5a48ff8cd08f123601cd0625ca62a86675aac9.tar.bz2
vcxsrv-5e5a48ff8cd08f123601cd0625ca62a86675aac9.zip
fontconfig libX11 mesa xserver git update 4 Jan 2015
xserver commit dc777c346d5d452a53b13b917c45f6a1bad2f20b libX11 commit 446f5f7f41317a85a0cd0efa5e6a1b37bc99fba2 fontconfig commit 4420b27c074821a1d1f9d6ebe822a610176a417d mesa commit 48094d0e6554a9df36bf00fc2793ade46cf92406
Diffstat (limited to 'fontconfig/src')
-rw-r--r--fontconfig/src/fccfg.c23
-rw-r--r--fontconfig/src/fcfreetype.c30
-rw-r--r--fontconfig/src/fcint.h2
-rw-r--r--fontconfig/src/fcmatch.c1
-rw-r--r--fontconfig/src/fcobjs.h1
5 files changed, 39 insertions, 18 deletions
diff --git a/fontconfig/src/fccfg.c b/fontconfig/src/fccfg.c
index 55cb297cd..b27ab0b43 100644
--- a/fontconfig/src/fccfg.c
+++ b/fontconfig/src/fccfg.c
@@ -367,6 +367,7 @@ FcConfigAddDirList (FcConfig *config, FcSetName set, FcStrSet *dirSet)
FcStrList *dirlist;
FcChar8 *dir;
FcCache *cache;
+ FcBool ret = FcFalse;
dirlist = FcStrListCreate (dirSet);
if (!dirlist)
@@ -381,9 +382,10 @@ FcConfigAddDirList (FcConfig *config, FcSetName set, FcStrSet *dirSet)
continue;
FcConfigAddCache (config, cache, set, dirSet);
FcDirCacheUnload (cache);
+ ret = FcTrue;
}
FcStrListDone (dirlist);
- return FcTrue;
+ return ret;
}
/*
@@ -2185,6 +2187,7 @@ FcConfigAppFontAddFile (FcConfig *config,
FcStrSet *subdirs;
FcStrList *sublist;
FcChar8 *subdir;
+ FcBool ret = FcFalse;
if (!config)
{
@@ -2218,12 +2221,13 @@ FcConfigAppFontAddFile (FcConfig *config,
{
while ((subdir = FcStrListNext (sublist)))
{
- FcConfigAppFontAddDir (config, subdir);
+ if (FcConfigAppFontAddDir (config, subdir))
+ ret = FcTrue;
}
FcStrListDone (sublist);
}
FcStrSetDestroy (subdirs);
- return FcTrue;
+ return ret;
}
FcBool
@@ -2232,6 +2236,7 @@ FcConfigAppFontAddDir (FcConfig *config,
{
FcFontSet *set;
FcStrSet *dirs;
+ FcBool ret = FcTrue;
if (!config)
{
@@ -2250,8 +2255,8 @@ FcConfigAppFontAddDir (FcConfig *config,
set = FcFontSetCreate ();
if (!set)
{
- FcStrSetDestroy (dirs);
- return FcFalse;
+ ret = FcFalse;
+ goto bail;
}
FcConfigSetFonts (config, set, FcSetApplication);
}
@@ -2259,12 +2264,10 @@ FcConfigAppFontAddDir (FcConfig *config,
FcStrSetAddFilename (dirs, dir);
if (!FcConfigAddDirList (config, FcSetApplication, dirs))
- {
- FcStrSetDestroy (dirs);
- return FcFalse;
- }
+ ret = FcFalse;
+bail:
FcStrSetDestroy (dirs);
- return FcTrue;
+ return ret;
}
void
diff --git a/fontconfig/src/fcfreetype.c b/fontconfig/src/fcfreetype.c
index aca2f70b2..81ebda707 100644
--- a/fontconfig/src/fcfreetype.c
+++ b/fontconfig/src/fcfreetype.c
@@ -1277,13 +1277,28 @@ FcFreeTypeQueryFace (const FT_Face face,
if (!pat)
goto bail0;
- if (!FcPatternAddBool (pat, FC_OUTLINE,
- (face->face_flags & FT_FACE_FLAG_SCALABLE) != 0))
- goto bail1;
+ {
+ int has_outline = !!(face->face_flags & FT_FACE_FLAG_SCALABLE);
+ int has_color = 0;
- if (!FcPatternAddBool (pat, FC_SCALABLE,
- (face->face_flags & FT_FACE_FLAG_SCALABLE) != 0))
- goto bail1;
+#ifdef FT_FACE_FLAG_COLOR
+ has_color = !!(face->face_flags & FT_FACE_FLAG_COLOR);
+#endif
+
+ if (!FcPatternAddBool (pat, FC_OUTLINE, has_outline))
+ goto bail1;
+
+#ifdef FT_FACE_FLAG_COLOR
+ if (!FcPatternAddBool (pat, FC_COLOR, has_color))
+ goto bail1;
+#endif
+
+ /* All color fonts are designed to be scaled, even if they only have
+ * bitmap strikes. Client is responsible to scale the bitmaps. This
+ * is in constrast to non-color strikes... */
+ if (!FcPatternAddBool (pat, FC_SCALABLE, has_outline || has_color))
+ goto bail1;
+ }
/*
@@ -1556,7 +1571,8 @@ FcFreeTypeQueryFace (const FT_Face face,
}
else
{
- strcpy (psname, tmp);
+ strncpy (psname, tmp, 255);
+ psname[255] = 0;
}
if (!FcPatternAddString (pat, FC_POSTSCRIPT_NAME, (const FcChar8 *)psname))
goto bail1;
diff --git a/fontconfig/src/fcint.h b/fontconfig/src/fcint.h
index 45dfc6e61..80205c950 100644
--- a/fontconfig/src/fcint.h
+++ b/fontconfig/src/fcint.h
@@ -470,7 +470,7 @@ typedef struct _FcCaseFold {
#define FC_CACHE_MAGIC_MMAP 0xFC02FC04
#define FC_CACHE_MAGIC_ALLOC 0xFC02FC05
-#define FC_CACHE_CONTENT_VERSION 4
+#define FC_CACHE_CONTENT_VERSION 5
struct _FcAtomic {
FcChar8 *file; /* original file name */
diff --git a/fontconfig/src/fcmatch.c b/fontconfig/src/fcmatch.c
index 25081e2cb..46d08bcc7 100644
--- a/fontconfig/src/fcmatch.c
+++ b/fontconfig/src/fcmatch.c
@@ -284,6 +284,7 @@ typedef enum _FcMatcherPriority {
PRI1(FILE),
PRI1(FONTFORMAT),
PRI1(SCALABLE),
+ PRI1(COLOR),
PRI1(FOUNDRY),
PRI1(CHARSET),
PRI_FAMILY_STRONG,
diff --git a/fontconfig/src/fcobjs.h b/fontconfig/src/fcobjs.h
index bfdf4b58b..573fa610d 100644
--- a/fontconfig/src/fcobjs.h
+++ b/fontconfig/src/fcobjs.h
@@ -68,4 +68,5 @@ FC_OBJECT (FONT_FEATURES, FcTypeString, NULL)
FC_OBJECT (PRGNAME, FcTypeString, NULL)
FC_OBJECT (HASH, FcTypeString, NULL) /* deprecated */
FC_OBJECT (POSTSCRIPT_NAME, FcTypeString, FcComparePostScript)
+FC_OBJECT (COLOR, FcTypeBool, FcCompareBool)
/* ^-------------- Add new objects here. */