aboutsummaryrefslogtreecommitdiff
path: root/fontconfig/src
diff options
context:
space:
mode:
Diffstat (limited to 'fontconfig/src')
-rw-r--r--fontconfig/src/fccfg.c23
-rw-r--r--fontconfig/src/fcfreetype.c32
-rw-r--r--fontconfig/src/fcint.h2
-rw-r--r--fontconfig/src/fcmatch.c1
-rw-r--r--fontconfig/src/fcobjs.h1
5 files changed, 40 insertions, 19 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 f356f27dc..357380070 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;
@@ -2190,7 +2206,7 @@ static const FcCharMap AdobeSymbol = {
static const FcFontDecode fcFontDecoders[] = {
{ ft_encoding_unicode, 0, (1 << 21) - 1 },
- { ft_encoding_symbol, &AdobeSymbol, (1 << 16) - 1 },
+ { ft_encoding_symbol, 0, (1 << 16) - 1 },
};
#define NUM_DECODE (int) (sizeof (fcFontDecoders) / sizeof (fcFontDecoders[0]))
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. */