aboutsummaryrefslogtreecommitdiff
path: root/fontconfig
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2015-02-22 21:39:56 +0100
committermarha <marha@users.sourceforge.net>2015-02-22 21:39:56 +0100
commit462f18c7b25fe3e467f837647d07ab0a78aa8d2b (patch)
treefc8013c0a1bac05a1945846c1697e973f4c35013 /fontconfig
parent36f711ee12b6dd5184198abed3aa551efb585587 (diff)
downloadvcxsrv-462f18c7b25fe3e467f837647d07ab0a78aa8d2b.tar.gz
vcxsrv-462f18c7b25fe3e467f837647d07ab0a78aa8d2b.tar.bz2
vcxsrv-462f18c7b25fe3e467f837647d07ab0a78aa8d2b.zip
Merged origin/release (checked in because wanted to merge new stuff)
Diffstat (limited to 'fontconfig')
-rw-r--r--fontconfig/README85
-rw-r--r--fontconfig/configure.ac15
-rw-r--r--fontconfig/doc/fcconfig.fncs10
-rw-r--r--fontconfig/doc/fcrange.fncs1
-rw-r--r--fontconfig/doc/fontconfig-devel.sgml13
-rw-r--r--fontconfig/doc/fontconfig-user.sgml9
-rw-r--r--fontconfig/fc-cache/fc-cache.c29
-rw-r--r--fontconfig/fc-cache/fc-cache.sgml33
-rw-r--r--fontconfig/fc-cat/fc-cat.sgml2
-rw-r--r--fontconfig/fontconfig/fontconfig.h5
-rw-r--r--fontconfig/m4/pkg.m4214
-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
16 files changed, 433 insertions, 42 deletions
diff --git a/fontconfig/README b/fontconfig/README
index 8b34edcae..6ac164469 100644
--- a/fontconfig/README
+++ b/fontconfig/README
@@ -1,12 +1,93 @@
Fontconfig
Font configuration and customization library
- Version 2.11.1
- 2014-03-24
+ Version 2.11.92 (2.12 RC2)
+ 2015-01-13
Check INSTALL for compilation and installation instructions.
Report bugs to https://bugs.freedesktop.org in the fontconfig module.
+2.11.92 (2.12 RC2)
+
+Akira TAGOH (1):
+ Add missing docs
+
+2.11.91 (2.12 RC1)
+
+Akira TAGOH (28):
+ Bug 71287 - size specific design selection support in OS/2 table version 5
+ Fix a build issue with freetype <2.5.1
+ Fix missing docs
+ Fix a typo
+ Fix fc-cache fail with -r
+ Rebase ja.orth against Joyo kanji characters
+ Allow the modification on FcTypeVoid with FcTypeLangSet and FcTypeCharSet
+ Workaround another race condition issue
+ Read the config files and fonts on the sysroot when --sysroot is given to fc-cache
+ Fix a segfault
+ Update CaseFolding.txt to Unicode 7.0
+ Don't read/write from/to the XDG dirs if the home directory is disabled
+ Rework for 5004e8e01f5de30ad01904e57ea0eda006ab3a0c
+ Fix a crash when no sysroot is given and failed to load the default fonts.conf
+ Fix a gcc warning
+ Don't add duplicate lang
+ fallback to the another method to lock when link() failed
+ Increase the refcount in FcConfigSetCurrent()
+ Fix the memory leak in fc-cat
+ Note FcConfigSetCurrent() increases the refcount in document
+ Add FcRangeGetDouble()
+ Revert "Bug 73291 - poppler does not show fl ligature"
+ Update aliases for new URW fonts
+ Returns False if no fonts found
+ fc-cache: make a fail if no fonts processed on a given path
+ fc-cache: Add an option to raise an error if no fonts found
+ Bump the cache version to 5
+ Fix a typo
+
+Behdad Esfahbod (39):
+ Remove unused code
+ Simplify hash code
+ Further simplify hash code
+ Rewrite hashing to use FT_Stream directly
+ Allow passing NULL for file to FcFreeTypeQueryFace()
+ [ko.orth] Remove U+3164 HANGUL FILLER
+ Deprecate FC_HASH and don't compute it
+ Remove unused FcHash code now that FC_HASH is deprecated
+ Update list of blanks to Unicode 6.3.0
+ Update blanks to Unicode 7.0
+ Change charset parse/unparse format to be human readable
+ Minor
+ Fix charset unparse after recent changes
+ Comments
+ Remove HASH from matching priorities
+ Fixup previous commit
+ Update mingw32 MemoryBarrier from HarfBuzz
+ More mingw32 MemoryBarrier() fixup
+ Symlinks fix for DESTDIR
+ Revert "Symlinks fix for DESTDIR"
+ Call FcInitDebug from FcFreeTypeQueryFace
+ Decode MacRoman encoding in name table without iconv
+ Ouch, fix buffer
+ Use lang=und instead of lang=xx for "undetermined"
+ Remove unused regex code
+ Improve / cleanup namelang matching
+ Add FC_WEIGHT_DEMILIGHT
+ Change DemiLight from 65 to 55
+ Linearly interpolate weight values
+ Export recently added API
+ Remove unneeded FcPublic
+ Fix assertion failure
+ If OS/2 table says weight is 1 to 9, multiply by 100
+ Trebuchet MS is a sans-serif font, not serif
+ Fix previous commit
+ Revert "[fcmatch] When matching, reserve score 0 for when elements don't exist"
+ Fix buffer overflow in copying PS name
+ Add FC_COLOR
+ Treat color fonts as scalable
+
+Nick Alcock (1):
+ Generate documentation for FcWeight* functions.
+
2.11.1
Akira TAGOH (31):
diff --git a/fontconfig/configure.ac b/fontconfig/configure.ac
index a366853e2..9011f37a3 100644
--- a/fontconfig/configure.ac
+++ b/fontconfig/configure.ac
@@ -33,7 +33,7 @@ dnl This is the package version number, not the shared library
dnl version. This same version number must appear in fontconfig/fontconfig.h
dnl Yes, it is a pain to synchronize version numbers. Unfortunately, it's
dnl not possible to extract the version number here from fontconfig.h
-AC_INIT([fontconfig], [2.11.1], [https://bugs.freedesktop.org/enter_bug.cgi?product=fontconfig])
+AC_INIT([fontconfig], [2.11.92], [https://bugs.freedesktop.org/enter_bug.cgi?product=fontconfig])
AM_INIT_AUTOMAKE([1.11 parallel-tests dist-bzip2])
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
@@ -103,11 +103,22 @@ if test "$os_win32" = "yes"; then
fi
AM_CONDITIONAL(MS_LIB_AVAILABLE, test x$ms_librarian = xyes)
+AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
WARN_CFLAGS=""
+WERROR_CFLAGS="-Werror"
+WARNING_CPP_DIRECTIVE="no"
if test "x$GCC" = "xyes"; then
WARN_CFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes \
-Wmissing-prototypes -Wmissing-declarations \
-Wnested-externs -fno-strict-aliasing"
+ WARNING_CPP_DIRECTIVE="yes"
+elif test "x$SUNCC" = "xyes"; then
+ WARN_CFLAGS="-v -fd"
+ WERROR_CFLAGS="-errtags \
+ -errwarn=%all,no%E_OLD_STYLE_FUNC_DEF,no%E_STATEMENT_NOT_REACHED"
+ WARNING_CPP_DIRECTIVE="yes"
+fi
+if test "x$WARNING_CPP_DIRECTIVE" = "xyes"; then
AC_DEFINE_UNQUOTED(HAVE_WARNING_CPP_DIRECTIVE,1,
[Can use #warning in C files])
fi
@@ -159,7 +170,7 @@ AC_DEFINE_UNQUOTED([HAVE_POSIX_FADVISE], [$fc_func_posix_fadvise], [Define to 1
if test "$os_win32" = "no"; then
AC_MSG_CHECKING([for scandir])
fc_saved_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $WARN_CFLAGS -Werror"
+ CFLAGS="$CFLAGS $WARN_CFLAGS $WERROR_CFLAGS"
AC_TRY_COMPILE([
#include <dirent.h>
int main(void);
diff --git a/fontconfig/doc/fcconfig.fncs b/fontconfig/doc/fcconfig.fncs
index 10f5afc7f..af328fc70 100644
--- a/fontconfig/doc/fcconfig.fncs
+++ b/fontconfig/doc/fcconfig.fncs
@@ -219,8 +219,9 @@ If <parameter>config</parameter> is NULL, the current configuration is used.
@PURPOSE@ Add font file to font database
@DESC@
Adds an application-specific font to the configuration. Returns FcFalse
-if the fonts cannot be added (due to allocation failure). Otherwise returns FcTrue.
-If <parameter>config</parameter> is NULL, the current configuration is used.
+if the fonts cannot be added (due to allocation failure or no fonts found).
+Otherwise returns FcTrue. If <parameter>config</parameter> is NULL,
+the current configuration is used.
@@
@RET@ FcBool
@@ -231,8 +232,9 @@ If <parameter>config</parameter> is NULL, the current configuration is used.
@DESC@
Scans the specified directory for fonts, adding each one found to the
application-specific set of fonts. Returns FcFalse
-if the fonts cannot be added (due to allocation failure). Otherwise returns FcTrue.
-If <parameter>config</parameter> is NULL, the current configuration is used.
+if the fonts cannot be added (due to allocation failure or no fonts found).
+Otherwise returns FcTrue. If <parameter>config</parameter> is NULL,
+the current configuration is used.
@@
@RET@ void
diff --git a/fontconfig/doc/fcrange.fncs b/fontconfig/doc/fcrange.fncs
index 4181b8093..ba76f65b2 100644
--- a/fontconfig/doc/fcrange.fncs
+++ b/fontconfig/doc/fcrange.fncs
@@ -72,3 +72,4 @@ all memory associated with it.
@DESC@
Returns in <parameter>begin</parameter> and <parameter>end</parameter> as the range.
@SINCE@ 2.11.91
+@@
diff --git a/fontconfig/doc/fontconfig-devel.sgml b/fontconfig/doc/fontconfig-devel.sgml
index 2b1122f18..0fa4605b5 100644
--- a/fontconfig/doc/fontconfig-devel.sgml
+++ b/fontconfig/doc/fontconfig-devel.sgml
@@ -20,6 +20,7 @@
<!ENTITY fcstring SYSTEM "fcstring.sgml">
<!ENTITY fcstrset SYSTEM "fcstrset.sgml">
<!ENTITY fcvalue SYSTEM "fcvalue.sgml">
+<!ENTITY fcweight SYSTEM "fcweight.sgml">
<!ENTITY version SYSTEM "version.sgml">
]>
<!--
@@ -176,6 +177,7 @@ convenience for the application's rendering mechanism.
scalable FC_SCALABLE Bool Whether glyphs can be scaled
scale FC_SCALE Double Scale factor for point->pixel
conversions
+ color FC_COLOR Bool Whether any glyphs have color
dpi FC_DPI Double Target dots per inch
rgba FC_RGBA Int unknown, rgb, bgr, vrgb,
vbgr, none - subpixel geometry
@@ -189,8 +191,13 @@ convenience for the application's rendering mechanism.
fontversion FC_FONTVERSION Int Version number of the font
capability FC_CAPABILITY String List of layout capabilities in
the font
+ fontformat FC_FONTFORMAT String String name of the font format
embolden FC_EMBOLDEN Bool Rasterizer should
synthetically embolden the font
+ embeddedbitmap FC_EMBEDDED_BITMAP Bool Use the embedded bitmap instead
+ of the outline
+ decorative FC_DECORATIVE Bool Whether the style is a decorative
+ variant
fontfeatures FC_FONT_FEATURES String List of extra feature tags in
OpenType to be enabled
namelang FC_NAMELANG String Language name to be used for the
@@ -536,6 +543,12 @@ Provides for application-specified symbolic constants for font names.
</para>
&fcconstant;
</sect2>
+ <sect2><title>FcWeight</title>
+ <para>
+Maps weights to and from OpenType weights.
+ </para>
+ &fcweight;
+ </sect2>
<sect2><title>FcBlanks</title>
<para>
An FcBlanks object holds a list of Unicode chars which are expected to
diff --git a/fontconfig/doc/fontconfig-user.sgml b/fontconfig/doc/fontconfig-user.sgml
index 482b45331..ac9d8079e 100644
--- a/fontconfig/doc/fontconfig-user.sgml
+++ b/fontconfig/doc/fontconfig-user.sgml
@@ -119,6 +119,7 @@ convenience for the applications' rendering mechanism.
rasterizer String Which rasterizer is in use (deprecated)
outline Bool Whether the glyphs are outlines
scalable Bool Whether glyphs can be scaled
+ color Bool Whether any glyphs have color
scale Double Scale factor for point->pixel conversions
dpi Double Target dots per inch
rgba Int unknown, rgb, bgr, vrgb, vbgr,
@@ -130,9 +131,15 @@ convenience for the applications' rendering mechanism.
font supports
fontversion Int Version number of the font
capability String List of layout capabilities in the font
+ fontformat String String name of the font format
embolden Bool Rasterizer should synthetically embolden the font
+ embeddedbitmap Bool Use the embedded bitmap instead of the outline
+ decorative Bool Whether the style is a decorative variant
fontfeatures String List of the feature tags in OpenType to be enabled
+ namelang String Language name to be used for the default value of
+ familylang, stylelang, and fullnamelang
prgname String String Name of the running program
+ postscriptname String Font family name in PostScript
</programlisting>
</refsect2>
<refsect2>
@@ -314,7 +321,7 @@ the configuration file, the directory that can be accessed first in the list
will be used to store the cache files. If it starts with '~', it refers to
a directory in the users home directory. If 'prefix' is set to "xdg", the value in the XDG_CACHE_HOME environment variable will be added as the path prefix. please see XDG Base Directory Specification for more details.
The default directory is ``$XDG_CACHE_HOME/fontconfig'' and it contains the cache files
-named ``<literal>&lt;hash value&gt;</literal>-<literal>&lt;architecture&gt;</literal>.cache-<literal>&lt;version</literal>'',
+named ``<literal>&lt;hash value&gt;</literal>-<literal>&lt;architecture&gt;</literal>.cache-<literal>&lt;version&gt;</literal>'',
where <literal>&lt;version&gt;</literal> is the font configureation file
version number (currently 3).
</para></refsect2>
diff --git a/fontconfig/fc-cache/fc-cache.c b/fontconfig/fc-cache/fc-cache.c
index 406ac6a8a..18cd6c5d6 100644
--- a/fontconfig/fc-cache/fc-cache.c
+++ b/fontconfig/fc-cache/fc-cache.c
@@ -65,6 +65,7 @@
#define _GNU_SOURCE
#include <getopt.h>
const struct option longopts[] = {
+ {"error-on-no-fonts", 0, 0, 'E'},
{"force", 0, 0, 'f'},
{"really-force", 0, 0, 'r'},
{"sysroot", required_argument, 0, 'y'},
@@ -86,16 +87,17 @@ usage (char *program, int error)
{
FILE *file = error ? stderr : stdout;
#if HAVE_GETOPT_LONG
- fprintf (file, "usage: %s [-frsvVh] [-y SYSROOT] [--force|--really-force] [--sysroot=SYSROOT] [--system-only] [--verbose] [--version] [--help] [dirs]\n",
+ fprintf (file, "usage: %s [-EfrsvVh] [-y SYSROOT] [--error-on-no-fonts] [--force|--really-force] [--sysroot=SYSROOT] [--system-only] [--verbose] [--version] [--help] [dirs]\n",
program);
#else
- fprintf (file, "usage: %s [-frsvVh] [-y SYSROOT] [dirs]\n",
+ fprintf (file, "usage: %s [-EfrsvVh] [-y SYSROOT] [dirs]\n",
program);
#endif
fprintf (file, "Build font information caches in [dirs]\n"
"(all directories in font configuration by default).\n");
fprintf (file, "\n");
#if HAVE_GETOPT_LONG
+ fprintf (file, " -E, --error-on-no-fonts raise an error if no fonts in a directory\n");
fprintf (file, " -f, --force scan directories with apparently valid caches\n");
fprintf (file, " -r, --really-force erase all existing caches, then rescan\n");
fprintf (file, " -s, --system-only scan system-wide directories only\n");
@@ -104,6 +106,8 @@ usage (char *program, int error)
fprintf (file, " -V, --version display font config version and exit\n");
fprintf (file, " -h, --help display this help and exit\n");
#else
+ fprintf (file, " -E (error-on-no-fonts)\n");
+ fprintf (file, " raise an error if no fonts in a directory\n");
fprintf (file, " -f (force) scan directories with apparently valid caches\n");
fprintf (file, " -r, (really force) erase all existing caches, then rescan\n");
fprintf (file, " -s (system) scan system-wide directories only\n");
@@ -118,7 +122,7 @@ usage (char *program, int error)
static FcStrSet *processed_dirs;
static int
-scanDirs (FcStrList *list, FcConfig *config, FcBool force, FcBool really_force, FcBool verbose, FcBool recursive, int *changed, FcStrSet *updateDirs)
+scanDirs (FcStrList *list, FcConfig *config, FcBool force, FcBool really_force, FcBool verbose, FcBool recursive, FcBool error_on_no_fonts, int *changed, FcStrSet *updateDirs)
{
int ret = 0;
const FcChar8 *dir;
@@ -126,7 +130,7 @@ scanDirs (FcStrList *list, FcConfig *config, FcBool force, FcBool really_force,
FcStrList *sublist;
FcCache *cache;
struct stat statb;
- FcBool was_valid;
+ FcBool was_valid, was_processed = FcFalse;
int i;
const FcChar8 *sysroot = FcConfigGetSysRoot (config);
@@ -175,6 +179,7 @@ scanDirs (FcStrList *list, FcConfig *config, FcBool force, FcBool really_force,
fprintf (stderr, "\"%s\": not a directory, skipping\n", dir);
continue;
}
+ was_processed = FcTrue;
if (really_force)
FcDirCacheUnlink (dir, config);
@@ -250,12 +255,14 @@ scanDirs (FcStrList *list, FcConfig *config, FcBool force, FcBool really_force,
continue;
}
FcStrSetAdd (processed_dirs, dir);
- ret += scanDirs (sublist, config, force, really_force, verbose, recursive, changed, updateDirs);
+ ret += scanDirs (sublist, config, force, really_force, verbose, recursive, error_on_no_fonts, changed, updateDirs);
FcStrListDone (sublist);
}
else
FcDirCacheUnload (cache);
}
+ if (error_on_no_fonts && !was_processed)
+ ret++;
return ret;
}
@@ -289,6 +296,7 @@ main (int argc, char **argv)
FcBool force = FcFalse;
FcBool really_force = FcFalse;
FcBool systemOnly = FcFalse;
+ FcBool error_on_no_fonts = FcFalse;
FcConfig *config;
FcChar8 *sysroot = NULL;
int i;
@@ -298,12 +306,15 @@ main (int argc, char **argv)
int c;
#if HAVE_GETOPT_LONG
- while ((c = getopt_long (argc, argv, "frsy:Vvh", longopts, NULL)) != -1)
+ while ((c = getopt_long (argc, argv, "Efrsy:Vvh", longopts, NULL)) != -1)
#else
- while ((c = getopt (argc, argv, "frsy:Vvh")) != -1)
+ while ((c = getopt (argc, argv, "Efrsy:Vvh")) != -1)
#endif
{
switch (c) {
+ case 'E':
+ error_on_no_fonts = FcTrue;
+ break;
case 'r':
really_force = FcTrue;
/* fall through */
@@ -384,13 +395,13 @@ main (int argc, char **argv)
updateDirs = FcStrSetCreate ();
changed = 0;
- ret = scanDirs (list, config, force, really_force, verbose, FcTrue, &changed, updateDirs);
+ ret = scanDirs (list, config, force, really_force, verbose, FcTrue, error_on_no_fonts, &changed, updateDirs);
/* Update the directory cache again to avoid the race condition as much as possible */
FcStrListDone (list);
list = FcStrListCreate (updateDirs);
if (list)
{
- ret += scanDirs (list, config, FcTrue, FcFalse, verbose, FcFalse, &changed, NULL);
+ ret += scanDirs (list, config, FcTrue, FcFalse, verbose, FcFalse, error_on_no_fonts, &changed, NULL);
FcStrListDone (list);
}
FcStrSetDestroy (updateDirs);
diff --git a/fontconfig/fc-cache/fc-cache.sgml b/fontconfig/fc-cache/fc-cache.sgml
index 3740be77f..5ae010765 100644
--- a/fontconfig/fc-cache/fc-cache.sgml
+++ b/fontconfig/fc-cache/fc-cache.sgml
@@ -63,9 +63,14 @@ manpage.1: manpage.sgml
<cmdsynopsis>
<command>&dhpackage;</command>
- <arg><option>-frsvVh</option></arg>
+ <arg><option>-EfrsvVh</option></arg>
+ <arg><option>--error-on-no-fonts</option></arg>
<arg><option>--force</option></arg>
<arg><option>--really-force</option></arg>
+ <group>
+ <arg><option>-y</option> <option><replaceable>dir</replaceable></option></arg>
+ <arg><option>--sysroot</option> <option><replaceable>dir</replaceable></option></arg>
+ </group>
<arg><option>--system-only</option></arg>
<arg><option>--verbose</option></arg>
<arg><option>--version</option></arg>
@@ -103,6 +108,16 @@ manpage.1: manpage.sgml
<variablelist>
<varlistentry>
+ <term><option>-E</option>
+ <option>--error-on-no-fonts</option>
+ </term>
+ <listitem>
+ <para>Raise an error if there are no fonts in
+ <option><replaceable>dir</replaceable></option> or directories
+ in the configuration if not given.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
<term><option>-f</option>
<option>--force</option>
</term>
@@ -137,6 +152,15 @@ manpage.1: manpage.sgml
</listitem>
</varlistentry>
<varlistentry>
+ <term><option>-y</option>
+ <option>-sysroot</option>
+ <option><replaceable>dir</replaceable></option>
+ </term>
+ <listitem>
+ <para>Prepend <option><replaceable>dir</replaceable></option> to all paths for scanning.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
<term><option>-h</option>
<option>--help</option>
</term>
@@ -163,10 +187,15 @@ manpage.1: manpage.sgml
</refsect1>
<refsect1>
+ <title>RETURN CODES</title>
+ <para><command>fc-cache</command> returns zero if the caches successfully generated. otherwise non-zero.</para>
+ </refsect1>
+
+ <refsect1>
<title>FILES</title>
<variablelist>
<varlistentry>
- <term><filename><replaceable>%cachdir%</replaceable>/*-<replaceable>%arch%</replaceable>.cache-2</filename></term>
+ <term><filename><replaceable>%cachedir%</replaceable>/*-<replaceable>%arch%</replaceable>.cache-%version%</filename></term>
<listitem>
<para>These files are generated by <command>&dhpackage;</command>
and contain maps from file names to font properties. They are
diff --git a/fontconfig/fc-cat/fc-cat.sgml b/fontconfig/fc-cat/fc-cat.sgml
index ce4736de5..a51325433 100644
--- a/fontconfig/fc-cat/fc-cat.sgml
+++ b/fontconfig/fc-cat/fc-cat.sgml
@@ -70,7 +70,7 @@ manpage.1: manpage.sgml
<arg><option>--help</option></arg>
<sbr>
<group rep="repeat">
- <arg><option><replaceable>fonts-cache-2-files</replaceable></option></arg>
+ <arg><option><replaceable>fonts-cache-%version%-files</replaceable></option></arg>
<arg><option><replaceable>dirs</replaceable></option></arg>
</group>
diff --git a/fontconfig/fontconfig/fontconfig.h b/fontconfig/fontconfig/fontconfig.h
index afc917c6b..600ed6881 100644
--- a/fontconfig/fontconfig/fontconfig.h
+++ b/fontconfig/fontconfig/fontconfig.h
@@ -52,7 +52,7 @@ typedef int FcBool;
#define FC_MAJOR 2
#define FC_MINOR 11
-#define FC_REVISION 1
+#define FC_REVISION 92
#define FC_VERSION ((FC_MAJOR * 10000) + (FC_MINOR * 100) + (FC_REVISION))
@@ -66,7 +66,7 @@ typedef int FcBool;
* it means multiple copies of the font information.
*/
-#define FC_CACHE_VERSION "4"
+#define FC_CACHE_VERSION "5"
#define FcTrue 1
#define FcFalse 0
@@ -94,6 +94,7 @@ typedef int FcBool;
#define FC_RASTERIZER "rasterizer" /* String (deprecated) */
#define FC_OUTLINE "outline" /* Bool */
#define FC_SCALABLE "scalable" /* Bool */
+#define FC_COLOR "color" /* Bool */
#define FC_SCALE "scale" /* double */
#define FC_DPI "dpi" /* double */
#define FC_RGBA "rgba" /* Int */
diff --git a/fontconfig/m4/pkg.m4 b/fontconfig/m4/pkg.m4
new file mode 100644
index 000000000..c5b26b52e
--- /dev/null
+++ b/fontconfig/m4/pkg.m4
@@ -0,0 +1,214 @@
+# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
+# serial 1 (pkg-config-0.24)
+#
+# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# PKG_PROG_PKG_CONFIG([MIN-VERSION])
+# ----------------------------------
+AC_DEFUN([PKG_PROG_PKG_CONFIG],
+[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
+m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
+AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
+AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+ AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+fi
+if test -n "$PKG_CONFIG"; then
+ _pkg_min_version=m4_default([$1], [0.9.0])
+ AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ PKG_CONFIG=""
+ fi
+fi[]dnl
+])# PKG_PROG_PKG_CONFIG
+
+# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+#
+# Check to see whether a particular set of modules exists. Similar
+# to PKG_CHECK_MODULES(), but does not set variables or print errors.
+#
+# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+# only at the first occurence in configure.ac, so if the first place
+# it's called might be skipped (such as if it is within an "if", you
+# have to call PKG_CHECK_EXISTS manually
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_EXISTS],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+if test -n "$PKG_CONFIG" && \
+ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
+ m4_default([$2], [:])
+m4_ifvaln([$3], [else
+ $3])dnl
+fi])
+
+# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+# ---------------------------------------------
+m4_define([_PKG_CONFIG],
+[if test -n "$$1"; then
+ pkg_cv_[]$1="$$1"
+ elif test -n "$PKG_CONFIG"; then
+ PKG_CHECK_EXISTS([$3],
+ [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes ],
+ [pkg_failed=yes])
+ else
+ pkg_failed=untried
+fi[]dnl
+])# _PKG_CONFIG
+
+# _PKG_SHORT_ERRORS_SUPPORTED
+# -----------------------------
+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi[]dnl
+])# _PKG_SHORT_ERRORS_SUPPORTED
+
+
+# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+# [ACTION-IF-NOT-FOUND])
+#
+#
+# Note that if there is a possibility the first call to
+# PKG_CHECK_MODULES might not happen, you should be sure to include an
+# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
+#
+#
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_MODULES],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
+
+pkg_failed=no
+AC_MSG_CHECKING([for $1])
+
+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
+_PKG_CONFIG([$1][_LIBS], [libs], [$2])
+
+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
+and $1[]_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.])
+
+if test $pkg_failed = yes; then
+ AC_MSG_RESULT([no])
+ _PKG_SHORT_ERRORS_SUPPORTED
+ if test $_pkg_short_errors_supported = yes; then
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
+ else
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+ m4_default([$4], [AC_MSG_ERROR(
+[Package requirements ($2) were not met:
+
+$$1_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+_PKG_TEXT])[]dnl
+ ])
+elif test $pkg_failed = untried; then
+ AC_MSG_RESULT([no])
+ m4_default([$4], [AC_MSG_FAILURE(
+[The pkg-config script could not be found or is too old. Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+_PKG_TEXT
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
+ ])
+else
+ $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
+ $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+ AC_MSG_RESULT([yes])
+ $3
+fi[]dnl
+])# PKG_CHECK_MODULES
+
+
+# PKG_INSTALLDIR(DIRECTORY)
+# -------------------------
+# Substitutes the variable pkgconfigdir as the location where a module
+# should install pkg-config .pc files. By default the directory is
+# $libdir/pkgconfig, but the default can be changed by passing
+# DIRECTORY. The user can override through the --with-pkgconfigdir
+# parameter.
+AC_DEFUN([PKG_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+ [pkg-config installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([pkgconfigdir],
+ [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
+ [with_pkgconfigdir=]pkg_default)
+AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+]) dnl PKG_INSTALLDIR
+
+
+# PKG_NOARCH_INSTALLDIR(DIRECTORY)
+# -------------------------
+# Substitutes the variable noarch_pkgconfigdir as the location where a
+# module should install arch-independent pkg-config .pc files. By
+# default the directory is $datadir/pkgconfig, but the default can be
+# changed by passing DIRECTORY. The user can override through the
+# --with-noarch-pkgconfigdir parameter.
+AC_DEFUN([PKG_NOARCH_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+ [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([noarch-pkgconfigdir],
+ [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
+ [with_noarch_pkgconfigdir=]pkg_default)
+AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+]) dnl PKG_NOARCH_INSTALLDIR
+
+
+# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
+# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# -------------------------------------------
+# Retrieves the value of the pkg-config variable for the given module.
+AC_DEFUN([PKG_CHECK_VAR],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
+
+_PKG_CONFIG([$1], [variable="][$3]["], [$2])
+AS_VAR_COPY([$1], [pkg_cv_][$1])
+
+AS_VAR_IF([$1], [""], [$5], [$4])dnl
+])# PKG_CHECK_VAR
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. */