aboutsummaryrefslogtreecommitdiff
path: root/fontconfig
diff options
context:
space:
mode:
Diffstat (limited to 'fontconfig')
-rw-r--r--fontconfig/autogen.sh9
-rw-r--r--fontconfig/conf.d/10-no-sub-pixel.conf2
-rw-r--r--fontconfig/conf.d/30-metric-aliases.conf47
-rw-r--r--fontconfig/configure.ac64
-rw-r--r--fontconfig/m4/ac_check_symbol.m448
-rw-r--r--fontconfig/src/fccache.c2
-rw-r--r--fontconfig/src/fcdefault.c4
-rw-r--r--fontconfig/src/fcmatch.c5
8 files changed, 137 insertions, 44 deletions
diff --git a/fontconfig/autogen.sh b/fontconfig/autogen.sh
index 1482e401c..29c1fd26c 100644
--- a/fontconfig/autogen.sh
+++ b/fontconfig/autogen.sh
@@ -24,10 +24,19 @@ LIBTOOLIZE=${LIBTOOLIZE-libtoolize}
AUTOMAKE=${AUTOMAKE-automake}
AUTOHEADER=${AUTOHEADER-autoheader}
AUTOCONF=${AUTOCONF-autoconf}
+GPERF=${GPERF-gperf}
LIBTOOLIZE_FLAGS="--copy --force"
DIE=0
+($GPERF --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "You must have gperf installed to compile $PROJECT."
+ echo "Install the appropriate package for your distribution."
+ echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
+ DIE=1
+}
+
have_libtool=false
if $LIBTOOLIZE --version < /dev/null > /dev/null 2>&1 ; then
libtool_version=`$LIBTOOLIZE --version | sed 's/^.* \([0-9][.][0-9.]*\)[^ ]*$/\1/'`
diff --git a/fontconfig/conf.d/10-no-sub-pixel.conf b/fontconfig/conf.d/10-no-sub-pixel.conf
index cf1246561..635847c40 100644
--- a/fontconfig/conf.d/10-no-sub-pixel.conf
+++ b/fontconfig/conf.d/10-no-sub-pixel.conf
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
-<!-- Enable sub-pixel rendering -->
+<!-- Disable sub-pixel rendering -->
<match target="pattern">
<!--
This configuration is available on the major desktop environments.
diff --git a/fontconfig/conf.d/30-metric-aliases.conf b/fontconfig/conf.d/30-metric-aliases.conf
index d0d9ea2e0..49a960247 100644
--- a/fontconfig/conf.d/30-metric-aliases.conf
+++ b/fontconfig/conf.d/30-metric-aliases.conf
@@ -22,8 +22,11 @@ Microsoft fonts: Liberation fonts: Google CrOS core fonts: StarOffice fo
================ ====================== ======================= ================= ==============
Arial Liberation Sans Arimo Albany Albany AMT
Arial Narrow Liberation Sans Narrow
-Times New Roman Liberation Serif Cousine Thorndale Thorndale AMT
-Courier New Liberation Mono Tinos Cumberland Cumberland AMT
+Times New Roman Liberation Serif Tinos Thorndale Thorndale AMT
+Courier New Liberation Mono Cousine Cumberland Cumberland AMT
+Cambria Caladea
+Calibri Carlito
+Symbol SymbolNeu
Microsoft fonts: Other fonts:
================ ============
@@ -307,7 +310,26 @@ but in an order preferring similar designs first. We do this in three steps:
</default>
</alias>
+ <alias binding="same">
+ <family>Caladea</family>
+ <default>
+ <family>Cambria</family>
+ </default>
+ </alias>
+ <alias binding="same">
+ <family>Carlito</family>
+ <default>
+ <family>Calibri</family>
+ </default>
+ </alias>
+
+ <alias binding="same">
+ <family>SymbolNeu</family>
+ <default>
+ <family>Symbol</family>
+ </default>
+ </alias>
<!-- Accept the other group as fallback -->
@@ -494,4 +516,25 @@ but in an order preferring similar designs first. We do this in three steps:
</accept>
</alias>
+ <alias binding="same">
+ <family>Cambria</family>
+ <accept>
+ <family>Caladea</family>
+ </accept>
+ </alias>
+
+ <alias binding="same">
+ <family>Calibri</family>
+ <accept>
+ <family>Carlito</family>
+ </accept>
+ </alias>
+
+ <alias binding="same">
+ <family>Symbol</family>
+ <accept>
+ <family>SymbolNeu</family>
+ </accept>
+ </alias>
+
</fontconfig>
diff --git a/fontconfig/configure.ac b/fontconfig/configure.ac
index 44789149b..728a55099 100644
--- a/fontconfig/configure.ac
+++ b/fontconfig/configure.ac
@@ -148,52 +148,42 @@ AC_TYPE_PID_T
# Checks for library functions.
AC_FUNC_VPRINTF
AC_FUNC_MMAP
-AC_CHECK_FUNCS([link mkstemp mkostemp _mktemp_s mkdtemp getopt getopt_long getprogname getexecname rand random lrand48 random_r rand_r regcomp regerror regexec regfree fstatvfs fstatfs lstat])
+AC_CHECK_FUNCS([link mkstemp mkostemp _mktemp_s mkdtemp getopt getopt_long getprogname getexecname rand random lrand48 random_r rand_r readlink regcomp regerror regexec regfree fstatvfs fstatfs lstat])
dnl AC_CHECK_FUNCS doesn't check for header files.
dnl posix_fadvise() may be not available in older libc.
-fc_saved_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS $WARN_CFLAGS -Werror"
-AC_MSG_CHECKING([for posix_fadvise])
-AC_LINK_IFELSE([AC_LANG_SOURCE([[
- #include <fcntl.h>
- int main(void) {
- return posix_fadvise(0, 0, 0, 0);
- }
- ]])],[
- AC_MSG_RESULT([yes])
- AC_DEFINE([HAVE_POSIX_FADVISE], [1], [Define to 1 if you have the 'posix_fadvise' function.])
- ],[AC_MSG_RESULT([no])])
+AC_CHECK_SYMBOL([posix_fadvise], [fcntl.h], [fc_func_posix_fadvise=1], [fc_func_posix_fadvise=0])
+AC_DEFINE_UNQUOTED([HAVE_POSIX_FADVISE], [$fc_func_posix_fadvise], [Define to 1 if you have the 'posix_fadivse' function.])
if test "$os_win32" = "no"; then
AC_MSG_CHECKING([for scandir])
- AC_LINK_IFELSE([AC_LANG_SOURCE([[
+ fc_saved_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $WARN_CFLAGS -Werror"
+ AC_TRY_COMPILE([
#include <dirent.h>
- int comp(const struct dirent **, const struct dirent **);
- int comp(const struct dirent **a, const struct dirent **b) { return 0; }
- int main(void) {
- struct dirent **d;
- return scandir(".", &d, 0, &comp) >= 0;
- }
- ]])],[
+ int main(void);
+ ], [
+ int (* comp) (const struct dirent **, const struct dirent **) = 0;
+ struct dirent **d;
+ return scandir(".", &d, 0, comp) >= 0;
+ ], [
+ AC_MSG_RESULT([yes])
+ AC_DEFINE([HAVE_SCANDIR], [1], [Define to 1 if you have the 'scandir' function.])
+ ], [
+ AC_TRY_COMPILE([
+ #include <dirent.h>
+ int main(void);
+ ], [
+ int (* comp) (const void *, const void *) = 0;
+ struct dirent **d;
+ return scandir(".", &d, 0, comp) >= 0;
+ ], [
AC_MSG_RESULT([yes])
- AC_DEFINE([HAVE_SCANDIR], [1], [Define to 1 if you have the 'scandir' function.])
+ AC_DEFINE([HAVE_SCANDIR_VOID_P], [1], [Define to 1 if you have the 'scandir' function with int (* compar)(const void *, const void *)])
],[
- AC_LINK_IFELSE([AC_LANG_SOURCE([[
- #include <dirent.h>
- int comp(const void *, const void *);
- int comp(const void *a, const void *b) { return 0; }
- int main(void) {
- struct dirent **d;
- return scandir(".", &d, 0, &comp) >= 0;
- }
- ]])],[
- AC_MSG_RESULT([yes])
- AC_DEFINE([HAVE_SCANDIR_VOID_P], [1], [Define to 1 if you have the 'scandir' function with int (* compar)(const void *, const void *)])
- ],[
- AC_MSG_ERROR([
+ AC_MSG_ERROR([
*** No scandir function available.])
- ])
])
+ ])
fi
CFLAGS="$fc_saved_CFLAGS"
@@ -531,7 +521,7 @@ AC_ARG_WITH(cache-dir,
case $fc_cachedir in
no|yes)
if test "$os_win32" = "yes"; then
- fc_cachedir="WINDOWSTEMPDIR_FONTCONFIG_CACHE"
+ fc_cachedir="LOCAL_APPDATA_FONTCONFIG_CACHE"
else
fc_cachedir='${localstatedir}/cache/${PACKAGE}'
fi
diff --git a/fontconfig/m4/ac_check_symbol.m4 b/fontconfig/m4/ac_check_symbol.m4
new file mode 100644
index 000000000..41c15286a
--- /dev/null
+++ b/fontconfig/m4/ac_check_symbol.m4
@@ -0,0 +1,48 @@
+dnl @synopsis AC_CHECK_SYMBOL(SYMBOL, HEADER... [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]])
+dnl
+dnl a wrapper around AC_EGREP_HEADER the shellvar $ac_found will hold
+dnl the HEADER-name that had been containing the symbol. This value is
+dnl shown to the user.
+dnl
+dnl @category C
+dnl @author Guido U. Draheim <guidod@gmx.de>
+dnl @version 2006-10-13
+dnl @license GPLWithACException
+
+AC_DEFUN([AC_CHECK_SYMBOL],
+[AC_MSG_CHECKING([for $1 in $2])
+AC_CACHE_VAL(ac_cv_func_$1,
+[AC_REQUIRE_CPP()dnl
+changequote(, )dnl
+symbol="[^a-zA-Z_0-9]$1[^a-zA-Z_0-9]"
+changequote([, ])dnl
+ac_found=no
+for ac_header in $2 ; do
+ ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%' `
+ if test $ac_found != "yes" ; then
+ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ AC_EGREP_HEADER( $symbol, $ac_header, [ac_found="$ac_header"] )
+ fi
+ fi
+done
+if test "$ac_found" != "no" ; then
+ AC_MSG_RESULT($ac_found)
+ ifelse([$3], , :, [$3])
+else
+ AC_MSG_RESULT(no)
+ ifelse([$4], , , [$4
+])dnl
+fi
+])])
+
+dnl AC_CHECK_SYMBOLS( symbol..., header... [, action-if-found [, action-if-not-found]])
+AC_DEFUN([AC_CHECK_SYMBOLS],
+[for ac_func in $1
+do
+P4_CHECK_SYMBOL($ac_func, $2,
+[changequote(, )dnl
+ ac_tr_func=HAVE_`echo $ac_func | sed -e 'y:abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:' -e 's:[[^A-Z0-9]]:_:'`
+changequote([, ])dnl
+ AC_DEFINE_UNQUOTED($ac_tr_func) $2], $3)dnl
+done
+])
diff --git a/fontconfig/src/fccache.c b/fontconfig/src/fccache.c
index c7f243749..10eacffdf 100644
--- a/fontconfig/src/fccache.c
+++ b/fontconfig/src/fccache.c
@@ -573,7 +573,7 @@ FcDirCacheMapFd (int fd, struct stat *fd_stat, struct stat *dir_stat)
{
#if defined(HAVE_MMAP) || defined(__CYGWIN__)
cache = mmap (0, fd_stat->st_size, PROT_READ, MAP_SHARED, fd, 0);
-#if defined(HAVE_POSIX_FADVISE) && defined(POSIX_FADV_WILLNEED)
+#if (HAVE_POSIX_FADVISE) && defined(POSIX_FADV_WILLNEED)
posix_fadvise (fd, 0, fd_stat->st_size, POSIX_FADV_WILLNEED);
#endif
if (cache == MAP_FAILED)
diff --git a/fontconfig/src/fcdefault.c b/fontconfig/src/fcdefault.c
index c6397c0c2..4beda7c00 100644
--- a/fontconfig/src/fcdefault.c
+++ b/fontconfig/src/fcdefault.c
@@ -149,7 +149,7 @@ retry:
#else
# if defined (HAVE_GETEXECNAME)
const char *p = getexecname ();
-# else
+# elif defined (HAVE_READLINK)
char buf[PATH_MAX + 1];
int len;
char *p = NULL;
@@ -160,6 +160,8 @@ retry:
buf[len] = '\0';
p = buf;
}
+# else
+ char *p = NULL;
# endif
if (p)
{
diff --git a/fontconfig/src/fcmatch.c b/fontconfig/src/fcmatch.c
index 627aa1a16..93e013f9b 100644
--- a/fontconfig/src/fcmatch.c
+++ b/fontconfig/src/fcmatch.c
@@ -743,6 +743,7 @@ FcSortWalk (FcSortNode **n, int nnode, FcFontSet *fs, FcCharSet **csp, FcBool tr
{
FcBool ret = FcFalse;
FcCharSet *cs;
+ int i;
cs = 0;
if (trim || csp)
@@ -752,7 +753,7 @@ FcSortWalk (FcSortNode **n, int nnode, FcFontSet *fs, FcCharSet **csp, FcBool tr
goto bail;
}
- while (nnode--)
+ for (i = 0; i < nnode; i++)
{
FcSortNode *node = *n++;
FcBool adds_chars = FcFalse;
@@ -776,7 +777,7 @@ FcSortWalk (FcSortNode **n, int nnode, FcFontSet *fs, FcCharSet **csp, FcBool tr
* If this font isn't a subset of the previous fonts,
* add it to the list
*/
- if (!trim || adds_chars)
+ if (!i || !trim || adds_chars)
{
FcPatternReference (node->pattern);
if (FcDebug () & FC_DBG_MATCHV)