Various config changes plus a couple of optimizations from Owen

This commit is contained in:
Keith Packard 2002-08-19 19:32:05 +00:00
parent 5d43e79919
commit fa244f3d88
24 changed files with 159 additions and 277 deletions

View File

@ -1,3 +1,22 @@
Mon Aug 19 11:57:27 PDT 2002
+ Fix autoconf files to pass FONTCONFIG_PATH on
compile line so that ${prefix} gets substituted
correctly.
+ Use getc_unlocked/putc_unlocked on systems that
provide them to avoid damage done to stdio by posix
+ Eliminate FC_PATTERN and FcTypePattern in favor of
an extended api for FcConfigSubstitute which takes
both the font and the pattern.
+ Add 'sans serif' alias for 'sans-serif' as some apps
can't handle hyphens in family names
+ Eliminate pretense of support for libxml2
+ Comment origins of Han orthographies
Tue Jul 30 18:37:09 PDT 2002 keithp
+ Add binding property to edit element so that strong

View File

@ -97,12 +97,6 @@
/* Define to 1 if you have the `vprintf' function. */
#undef HAVE_VPRINTF
/* Use libxml2 library for xml parsing */
#undef HAVE_XML2
/* Define to 1 if you have the `xmlInitParser' function. */
#undef HAVE_XMLINITPARSER
/* Define to 1 if you have the `XML_ParserCreate' function. */
#undef HAVE_XML_PARSERCREATE
@ -142,6 +136,3 @@
/* Define to `int' if <sys/types.h> does not define. */
#undef pid_t
/* Define to the directory containing font configuration files */
#undef FONTCONFIG_PATH

View File

@ -1,5 +1,5 @@
#
# $XFree86: xc/lib/fontconfig/config/Makedefs.in,v 1.2 2002/05/21 17:48:15 keithp Exp $
# $XFree86: xc/lib/fontconfig/config/Makedefs.in,v 1.3 2002/08/01 15:57:26 keithp Exp $
#
# Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc.
#
@ -32,19 +32,12 @@ bindir=@bindir@
datadir=@datadir@
includedir=@includedir@
sysconfdir=@sysconfdir@
CDEBUGFLAGS=@CFLAGS@
CPPFLAGS=@CPPFLAGS@
DEFS=@DEFS@
confdir=@confdir@
DSO_LDOPTS=@DSO_LDOPTS@
DSO_CFLAGS=@DSO_CFLAGS@
DSO_PIC_CFLAGS=@DSO_PIC_CFLAGS@
INCLUDES=-I$(TOPDIR) -I$(srcdir)
CFLAGS=$(CDEBUGFLAGS) $(INCLUDES) $(DEFS) $(CPPFLAGS)
INSTALL=@INSTALL@
INSTALL_PROGRAM=@INSTALL_PROGRAM@
INSTALL_SCRIPT=@INSTALL_SCRIPT@
@ -52,10 +45,6 @@ INSTALL_DATA=@INSTALL_DATA@
MKSHLIB=@MKSHLIB@
LN_S=@LN_S@
X_FONT_DIR=@X_FONT_DIR@
FC_DEFAULT_FONTS=@FC_DEFAULT_FONTS@
FONTCONFIG_PATH=@FONTCONFIG_PATH@
# shared libraries
LIBDIR=$(libdir)
# programs
@ -65,6 +54,16 @@ CONFDIR=@CONFDIR@
# include files
INCLUDEDIR=$(includedir)/fontconfig
X_FONT_DIR=@X_FONT_DIR@
FC_DEFAULT_FONTS=@FC_DEFAULT_FONTS@
FCPATH_DEF=-DFONTCONFIG_PATH=\"$(CONFDIR)\"
CDEBUGFLAGS=@CFLAGS@
INCLUDES=-I$(TOPDIR) -I$(srcdir) @CPPFLAGS@
CFLAGS=$(CDEBUGFLAGS) @DEFS@ $(FCPATH_DEF) $(INCLUDES)
LIBBASE=libfontconfig.so
LIBFILE=$(LIBBASE).@PACKAGE_MAJOR@.@PACKAGE_MINOR@
LIBMAJOR=$(LIBBASE).@PACKAGE_MAJOR@

View File

@ -1,5 +1,5 @@
dnl
dnl $XFree86: xc/lib/fontconfig/configure.in,v 1.6 2002/06/07 17:55:41 keithp Exp $
dnl $XFree86: xc/lib/fontconfig/configure.in,v 1.7 2002/08/01 15:57:25 keithp Exp $
dnl
dnl Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc.
dnl
@ -23,6 +23,7 @@ dnl PERFORMANCE OF THIS SOFTWARE.
dnl
# Process this file with autoconf to produce a configure script.
AC_INIT(fontconfig, 1.0.1, fonts@xfree86.org)
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_HEADER(config.h)
@ -30,13 +31,11 @@ AC_CONFIG_HEADER(config.h)
AC_ARG_WITH(freetype_includes, [ --with-freetype-includes=DIR Use FreeType includes in DIR], freetype_includes=$withval, freetype_includes=yes)
AC_ARG_WITH(freetype_lib, [ --with-freetype-lib=DIR Use FreeType library in DIR], freetype_lib=$withval, freetype_lib=yes)
AC_ARG_WITH(freetype_config, [ --with-freetype-config=PROG Use FreeType configuration program PROG], freetype_config=$withval, freetype_config=yes)
AC_ARG_WITH(expat, [ --with-expat=DIR Use Expat in DIR instead of xml2], expat=$withval, expat=maybe)
AC_ARG_WITH(expat, [ --with-expat=DIR Use Expat in DIR], expat=$withval, expat=yes)
AC_ARG_WITH(expat_includes, [ --with-expat-includes=DIR Use Expat includes in DIR], expat_includes=$withval, expat_includes=yes)
AC_ARG_WITH(expat_lib, [ --with-expat-lib=DIR Use Expat library in DIR], expat_lib=$withval, expat_lib=yes)
AC_ARG_WITH(xml2, [ --with-xml2=DIR Use Libxml2 in DIR instead of expat], xml2=$withval, xml2=maybe)
AC_ARG_WITH(xml2_includes, [ --with-xml2-includes=DIR Use Libxml2 includes in DIR], xml2_includes=$withval, xml2_includes=yes)
AC_ARG_WITH(xml2_lib, [ --with-xml2-lib=DIR Use Libxml2 library in DIR], xml2_lib=$withval, xml2_lib=yes)
AC_ARG_WITH(default_fonts, [ --with-default-fonts=DIR Use fonts from DIR when config is busted], defaultfonts="$withval", default_fonts=yes)
AC_ARG_WITH(confdir, [ --with-confdir=DIR Use DIR to store configuration files (default /etc/fonts)], confdir="$withval", confdir=yes)
# Checks for programs.
AC_PROG_CC
@ -210,40 +209,22 @@ AC_SUBST(FC_DEFAULT_FONTS)
# Set CONFDIR and FONTCONFIG_PATH
#
CONFDIR="$sysconfdir/fonts"
case "$confdir" in
no|yes)
confdir=/etc/fonts
;;
*)
;;
esac
AC_SUBST(confdir)
CONFDIR='${confdir}'
AC_DEFINE_UNQUOTED(CONFDIR, "$CONFDIR")
AC_SUBST(CONFDIR)
FONTCONFIG_PATH="$CONFDIR"
AC_DEFINE_UNQUOTED(FONTCONFIG_PATH, "$CONFDIR")
AC_SUBST(FONTCONFIG_PATH)
#
# Check expat/libxml2 configuration
# Check expat configuration
#
case "$expat" in
maybe)
;;
no)
xml2=yes
;;
*)
xml2=no
;;
esac
case "$xml2" in
maybe)
;;
no)
expat=yes
;;
*)
expat=no
;;
esac
case "$expat" in
no)
;;
@ -259,7 +240,7 @@ no)
case "$expat_lib" in
yes)
case "$expat" in
yes|maybe)
yes)
expat_library="-lexpat"
;;
*)
@ -317,7 +298,6 @@ no)
HAVE_EXPAT=1
AC_SUBST(HAVE_EXPAT)
AC_DEFINE_UNQUOTED(HAVE_EXPAT,$HAVE_EXPAT)
xml2=no
;;
esac
;;
@ -325,71 +305,10 @@ no)
;;
esac
case "$xml2" in
case "$expat" in
no)
;;
*)
case "$xml2_includes" in
yes|no)
xml2_include_path=""
;;
*)
xml2_include_path="-I$xml2_includes"
;;
esac
case "$xml2_lib" in
yes)
case "$xml2" in
yes|maybe)
xml2_library="-lxml2"
;;
*)
xml2_library="-L$xml2/lib -lxml2"
;;
esac
;;
no)
;;
*)
xml2_library="-L$xml2_lib -lxml2"
;;
esac
saved_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $xml2_include_path"
saved_LIBS="$LIBS"
LIBS="$LIBS $xml2_library"
AC_CHECK_HEADER(libxml/parser.h)
case "$ac_cv_header_libxml_parser_h" in
no)
CPPFLAGS="$saved_CPPFLAGS"
LIBS="$saved_LIBS"
xml2=no
;;
yes)
AC_CHECK_FUNCS(xmlInitParser)
case "$ac_cv_func_xmlInitParser" in
no)
CPPFLAGS="$saved_CPPFLAGS"
LIBS="$saved_LIBS"
xml2=no
;;
yes)
HAVE_XML2=1
AC_SUBST(HAVE_XML2)
AC_DEFINE_UNQUOTED(HAVE_XML2,$HAVE_XML2)
expat=no
;;
esac
;;
esac
;;
esac
case "$expat""$xml2" in
nono)
AC_MSG_ERROR([cannot find either libxml2 or expat])
AC_MSG_ERROR([cannot find expat library])
;;
esac

View File

@ -5,7 +5,7 @@ XCOMM $XFree86$
#include "../local.def"
#endif
INCLUDES=$(FREETYPE2INCLUDES) $(LIBXML2INCLUDES) -I..
INCLUDES=$(FREETYPE2INCLUDES) -I..
LOCAL_LIBRARIES=FontconfigClientLibs
DEPLIBS=FontconfigClientDepLibs

View File

@ -1,11 +1,11 @@
XCOMM $XFree86: xc/lib/fontconfig/fc-lang/Imakefile,v 1.12 2002/08/06 18:59:59 keithp Exp $
XCOMM $XFree86: xc/lib/fontconfig/fc-lang/Imakefile,v 1.14 2002/08/08 00:10:49 keithp Exp $
#ifdef UseInstalled
/* building outside the tree, use private defines */
#include "../local.def"
#endif
INCLUDES=$(FREETYPE2INCLUDES) $(LIBXML2INCLUDES) -I.. -I../src
INCLUDES=$(FREETYPE2INCLUDES) -I.. -I../src
LOCAL_LIBRARIES=FontconfigClientLibs
DEPLIBS=FontconfigClientDepLibs

View File

@ -1,5 +1,5 @@
#
# $XFree86: xc/lib/fontconfig/fc-lang/ja.orth,v 1.2 2002/07/06 23:59:15 keithp Exp $
# $XFree86: xc/lib/fontconfig/fc-lang/ja.orth,v 1.3 2002/07/13 20:33:05 keithp Exp $
#
# Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc.
#
@ -21,6 +21,8 @@
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
#
# Coverage from JIS X 0208 (1990)
#
0x3000 # IDEOGRAPHIC SPACE
0x3001 # IDEOGRAPHIC COMMA
0x3002 # IDEOGRAPHIC FULL STOP

View File

@ -1,5 +1,5 @@
#
# $XFree86: xc/lib/fontconfig/fc-lang/ko.orth,v 1.2 2002/07/06 23:59:16 keithp Exp $
# $XFree86: xc/lib/fontconfig/fc-lang/ko.orth,v 1.3 2002/07/12 21:05:59 keithp Exp $
#
# Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc.
#
@ -22,6 +22,9 @@
# PERFORMANCE OF THIS SOFTWARE.
#
# Korean (KO)
#
# Coverage from KSC 5601-1992
#
#0x3000 # IDEOGRAPHIC SPACE
#0x3001 # IDEOGRAPHIC COMMA
#0x3002 # IDEOGRAPHIC FULL STOP

View File

@ -1,5 +1,5 @@
#
# $XFree86$
# $XFree86: xc/lib/fontconfig/fc-lang/zh_cn.orth,v 1.2 2002/07/06 23:59:19 keithp Exp $
#
# Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc.
#
@ -22,6 +22,9 @@
# PERFORMANCE OF THIS SOFTWARE.
#
# Chinese (simplified) (ZH-CN)
#
# Coverage computed from GB2312
#
0x02C7 # CARON (Mandarin Chinese third tone)
0x02C9 # MODIFIER LETTER MACRON (Mandarin Chinese first tone)
0x4E00 # <CJK>

View File

@ -1,5 +1,5 @@
#
# $XFree86$
# $XFree86: xc/lib/fontconfig/fc-lang/zh_sg.orth,v 1.1 2002/07/08 07:31:51 keithp Exp $
#
# Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc.
#
@ -23,5 +23,5 @@
#
# Chinese in Singapore (ZH-SG)
#
# Just use GB2312 as for ZH-CH
# Just use GB2312 as for ZH-CN
include zh_cn.orth

View File

@ -5,7 +5,7 @@ XCOMM $XFree86$
#include "../local.def"
#endif
INCLUDES=$(FREETYPE2INCLUDES) $(LIBXML2INCLUDES) -I..
INCLUDES=$(FREETYPE2INCLUDES) -I..
LOCAL_LIBRARIES=FontconfigClientLibs
DEPLIBS=FontconfigClientDepLibs

View File

@ -1,5 +1,5 @@
/*
* $XFree86: xc/lib/fontconfig/fontconfig/fcprivate.h,v 1.3 2002/05/31 23:21:24 keithp Exp $
* $XFree86: xc/lib/fontconfig/fontconfig/fcprivate.h,v 1.4 2002/08/11 18:10:41 keithp Exp $
*
* Copyright Š 2001 Keith Packard, member of The XFree86 Project, Inc.
*
@ -73,8 +73,6 @@
case FcTypeFTFace: \
__v__.u.f = va_arg (va, FT_Face); \
break; \
case FcTypePattern: \
__v__.u.p = va_arg (va, FcPattern *); \
} \
if (!FcPatternAdd (__p__, __o__, __v__, FcTrue)) \
goto _FcPatternVapBuild_bail1; \

View File

@ -1,5 +1,5 @@
/*
* $XFree86: xc/lib/fontconfig/fontconfig/fontconfig.h,v 1.23 2002/07/28 10:50:58 keithp Exp $
* $XFree86: xc/lib/fontconfig/fontconfig/fontconfig.h,v 1.25 2002/08/11 18:10:41 keithp Exp $
*
* Copyright © 2001 Keith Packard, member of The XFree86 Project, Inc.
*
@ -71,7 +71,6 @@ typedef int FcBool;
#define FC_SOURCE "source" /* String (X11, freetype) */
#define FC_CHARSET "charset" /* CharSet */
#define FC_LANG "lang" /* String OS/2 CodePageRange */
#define FC_PATTERN "pattern" /* FcPattern */
#define FC_DIR_CACHE_FILE "fonts.cache"
#define FC_USER_CACHE_FILE ".fonts.cache"
@ -110,8 +109,7 @@ typedef enum _FcType {
FcTypeBool,
FcTypeMatrix,
FcTypeCharSet,
FcTypeFTFace,
FcTypePattern
FcTypeFTFace
} FcType;
typedef struct _FcMatrix {
@ -278,6 +276,12 @@ FcConfigAppFontAddDir (FcConfig *config,
void
FcConfigAppFontClear (FcConfig *config);
FcBool
FcConfigSubstituteWithPat (FcConfig *config,
FcPattern *p,
FcPattern *p_pat,
FcMatchKind kind);
FcBool
FcConfigSubstitute (FcConfig *config,
FcPattern *p,
@ -605,9 +609,6 @@ FcPatternAddCharSet (FcPattern *p, const char *object, const FcCharSet *c);
FcBool
FcPatternAddBool (FcPattern *p, const char *object, FcBool b);
FcBool
FcPatternAddPattern (FcPattern *p, const char *object, const FcPattern *pp);
FcResult
FcPatternGetInteger (FcPattern *p, const char *object, int n, int *i);
@ -626,9 +627,6 @@ FcPatternGetCharSet (FcPattern *p, const char *object, int n, FcCharSet **c);
FcResult
FcPatternGetBool (FcPattern *p, const char *object, int n, FcBool *b);
FcResult
FcPatternGetPattern (FcPattern *p, const char *object, int n, FcPattern **pp);
FcPattern *
FcPatternVaBuild (FcPattern *orig, va_list va);

View File

@ -45,6 +45,18 @@
</edit>
</match>
<!--
Accept alternate 'sans serif' spelling, replacing it with 'sans-serif'
-->
<match target="pattern">
<test qual="any" name="family">
<string>sans serif</string>
</test>
<edit name="family" mode="assign">
<string>sans-serif</string>
</edit>
</match>
<!--
Accept deprecated 'sans' alias, replacing it with 'sans-serif'
-->

View File

@ -21,7 +21,7 @@ SOFONTCONFIGREV=1.0
#include <Threads.tmpl>
INCLUDES=$(FREETYPE2INCLUDES) $(LIBXML2INCLUDES) -I..
INCLUDES=$(FREETYPE2INCLUDES) -I..
DEFINES=-DFC_DEFAULT_FONTS='"$(FC_DEFAULT_FONTS)"' -DHAVE_EXPAT

View File

@ -1,5 +1,5 @@
/*
* $XFree86: xc/lib/fontconfig/src/fccache.c,v 1.7 2002/05/21 17:06:22 keithp Exp $
* $XFree86: xc/lib/fontconfig/src/fccache.c,v 1.10 2002/08/06 19:00:43 keithp Exp $
*
* Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
*
@ -24,6 +24,21 @@
#include "fcint.h"
/*
* POSIX has broken stdio so that getc must do thread-safe locking,
* this is a serious performance problem for applications doing large
* amounts of IO with getc (as is done here). If available, use
* the getc_unlocked varient instead.
*/
#if defined(getc_unlocked) || defined(_IO_getc_unlocked)
#define GETC(f) getc_unlocked(f)
#define PUTC(c,f) putc_unlocked(c,f)
#else
#define GETC(f) getc(f)
#define PUTC(c,f) putc(c,f)
#endif
#define FC_DBG_CACHE_REF 1024
static FcChar8 *
@ -35,7 +50,7 @@ FcCacheReadString (FILE *f, FcChar8 *dest, int len)
int size;
int i;
while ((c = getc (f)) != EOF)
while ((c = GETC (f)) != EOF)
if (c == '"')
break;
if (c == EOF)
@ -47,7 +62,7 @@ FcCacheReadString (FILE *f, FcChar8 *dest, int len)
i = 0;
d = dest;
escape = FcFalse;
while ((c = getc (f)) != EOF)
while ((c = GETC (f)) != EOF)
{
if (!escape)
{
@ -87,7 +102,7 @@ FcCacheReadUlong (FILE *f, unsigned long *dest)
unsigned long t;
int c;
while ((c = getc (f)) != EOF)
while ((c = GETC (f)) != EOF)
{
if (!isspace (c))
break;
@ -102,7 +117,7 @@ FcCacheReadUlong (FILE *f, unsigned long *dest)
if (!isdigit (c))
return FcFalse;
t = t * 10 + (c - '0');
c = getc (f);
c = GETC (f);
}
*dest = t;
return FcTrue;
@ -141,11 +156,11 @@ FcCacheWriteChars (FILE *f, const FcChar8 *chars)
switch (c) {
case '"':
case '\\':
if (putc ('\\', f) == EOF)
if (PUTC ('\\', f) == EOF)
return FcFalse;
/* fall through */
default:
if (putc (c, f) == EOF)
if (PUTC (c, f) == EOF)
return FcFalse;
}
}
@ -156,11 +171,11 @@ static FcBool
FcCacheWriteString (FILE *f, const FcChar8 *string)
{
if (putc ('"', f) == EOF)
if (PUTC ('"', f) == EOF)
return FcFalse;
if (!FcCacheWriteChars (f, string))
return FcFalse;
if (putc ('"', f) == EOF)
if (PUTC ('"', f) == EOF)
return FcFalse;
return FcTrue;
}
@ -168,17 +183,17 @@ FcCacheWriteString (FILE *f, const FcChar8 *string)
static FcBool
FcCacheWritePath (FILE *f, const FcChar8 *dir, const FcChar8 *file)
{
if (putc ('"', f) == EOF)
if (PUTC ('"', f) == EOF)
return FcFalse;
if (dir)
if (!FcCacheWriteChars (f, dir))
return FcFalse;
if (dir && dir[strlen((const char *) dir) - 1] != '/')
if (putc ('/', f) == EOF)
if (PUTC ('/', f) == EOF)
return FcFalse;
if (!FcCacheWriteChars (f, file))
return FcFalse;
if (putc ('"', f) == EOF)
if (PUTC ('"', f) == EOF)
return FcFalse;
return FcTrue;
}
@ -200,7 +215,7 @@ FcCacheWriteUlong (FILE *f, unsigned long t)
while (pow)
{
digit = temp / pow;
if (putc ((char) digit + '0', f) == EOF)
if (PUTC ((char) digit + '0', f) == EOF)
return FcFalse;
temp = temp - pow * digit;
pow = pow / 10;
@ -767,19 +782,19 @@ FcGlobalCacheSave (FcGlobalCache *cache,
continue;
if (!FcCacheWriteString (f, dir->info.file))
goto bail4;
if (putc (' ', f) == EOF)
if (PUTC (' ', f) == EOF)
goto bail4;
if (!FcCacheWriteInt (f, 0))
goto bail4;
if (putc (' ', f) == EOF)
if (PUTC (' ', f) == EOF)
goto bail4;
if (!FcCacheWriteTime (f, dir->info.time))
goto bail4;
if (putc (' ', f) == EOF)
if (PUTC (' ', f) == EOF)
goto bail4;
if (!FcCacheWriteString (f, (FcChar8 *) FC_FONT_FILE_DIR))
goto bail4;
if (putc ('\n', f) == EOF)
if (PUTC ('\n', f) == EOF)
goto bail4;
for (file_hash = 0; file_hash < FC_GLOBAL_CACHE_FILE_HASH_SIZE; file_hash++)
@ -790,19 +805,19 @@ FcGlobalCacheSave (FcGlobalCache *cache,
continue;
if (!FcCacheWritePath (f, dir->info.file, file->info.file))
goto bail4;
if (putc (' ', f) == EOF)
if (PUTC (' ', f) == EOF)
goto bail4;
if (!FcCacheWriteInt (f, file->id < 0 ? 0 : file->id))
goto bail4;
if (putc (' ', f) == EOF)
if (PUTC (' ', f) == EOF)
goto bail4;
if (!FcCacheWriteTime (f, file->info.time))
goto bail4;
if (putc (' ', f) == EOF)
if (PUTC (' ', f) == EOF)
goto bail4;
if (!FcCacheWriteString (f, file->name))
goto bail4;
if (putc ('\n', f) == EOF)
if (PUTC ('\n', f) == EOF)
goto bail4;
}
}
@ -981,15 +996,15 @@ FcDirCacheWriteDir (FcFontSet *set, FcStrSet *dirs, const FcChar8 *dir)
base = FcFileBaseName (cache_file, dir);
if (!FcCacheWriteString (f, base))
goto bail3;
if (putc (' ', f) == EOF)
if (PUTC (' ', f) == EOF)
goto bail3;
if (!FcCacheWriteInt (f, 0))
goto bail3;
if (putc (' ', f) == EOF)
if (PUTC (' ', f) == EOF)
goto bail3;
if (!FcCacheWriteString (f, FC_FONT_FILE_DIR))
goto bail3;
if (putc ('\n', f) == EOF)
if (PUTC ('\n', f) == EOF)
goto bail3;
}
@ -1005,11 +1020,11 @@ FcDirCacheWriteDir (FcFontSet *set, FcStrSet *dirs, const FcChar8 *dir)
printf (" write file \"%s\"\n", base);
if (!FcCacheWriteString (f, base))
goto bail3;
if (putc (' ', f) == EOF)
if (PUTC (' ', f) == EOF)
goto bail3;
if (!FcCacheWriteInt (f, id))
goto bail3;
if (putc (' ', f) == EOF)
if (PUTC (' ', f) == EOF)
goto bail3;
name = FcNameUnparse (font);
if (!name)
@ -1018,7 +1033,7 @@ FcDirCacheWriteDir (FcFontSet *set, FcStrSet *dirs, const FcChar8 *dir)
free (name);
if (!ret)
goto bail3;
if (putc ('\n', f) == EOF)
if (PUTC ('\n', f) == EOF)
goto bail3;
}

View File

@ -1,5 +1,5 @@
/*
* $XFree86: xc/lib/fontconfig/src/fccfg.c,v 1.18 2002/07/31 01:36:37 keithp Exp $
* $XFree86: xc/lib/fontconfig/src/fccfg.c,v 1.19 2002/08/11 18:10:42 keithp Exp $
*
* Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
*
@ -592,18 +592,6 @@ FcConfigCompareValue (FcValue m,
break;
}
break;
case FcTypePattern:
switch (op) {
case FcOpEqual:
ret = FcPatternEqual (m.u.p, v.u.p);
break;
case FcOpNotEqual:
ret = !FcPatternEqual (m.u.p, v.u.p);
break;
default:
break;
}
break;
}
}
else
@ -1009,9 +997,10 @@ FcConfigPatternCanon (FcPattern *p,
}
FcBool
FcConfigSubstitute (FcConfig *config,
FcPattern *p,
FcMatchKind kind)
FcConfigSubstituteWithPat (FcConfig *config,
FcPattern *p,
FcPattern *p_pat,
FcMatchKind kind)
{
FcSubst *s;
FcSubState *st;
@ -1019,7 +1008,6 @@ FcConfigSubstitute (FcConfig *config,
FcTest *t;
FcEdit *e;
FcValueList *l;
FcPattern *p_pat = 0;
FcPattern *m;
if (!config)
@ -1042,10 +1030,7 @@ FcConfigSubstitute (FcConfig *config,
if (kind == FcMatchPattern)
s = config->substPattern;
else
{
s = config->substFont;
(void) FcPatternGetPattern (p, FC_PATTERN, 0, &p_pat);
}
for (; s; s = s->next)
{
/*
@ -1222,6 +1207,14 @@ FcConfigSubstitute (FcConfig *config,
return FcTrue;
}
FcBool
FcConfigSubstitute (FcConfig *config,
FcPattern *p,
FcMatchKind kind)
{
return FcConfigSubstituteWithPat (config, p, 0, kind);
}
#ifndef FONTCONFIG_PATH
#define FONTCONFIG_PATH "/etc/fonts"
#endif

View File

@ -1,5 +1,5 @@
/*
* $XFree86: xc/lib/fontconfig/src/fcdbg.c,v 1.4 2002/06/19 20:08:22 keithp Exp $
* $XFree86: xc/lib/fontconfig/src/fcdbg.c,v 1.7 2002/08/11 18:10:42 keithp Exp $
*
* Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
*
@ -54,11 +54,6 @@ FcValuePrint (const FcValue v)
case FcTypeFTFace:
printf (" face");
break;
case FcTypePattern:
printf (" pattern {");
FcPatternPrint (v.u.p);
printf (" } ");
break;
}
}

View File

@ -1,5 +1,5 @@
/*
* $XFree86: xc/lib/fontconfig/src/fclist.c,v 1.7 2002/06/19 20:08:22 keithp Exp $
* $XFree86: xc/lib/fontconfig/src/fclist.c,v 1.8 2002/08/11 18:10:42 keithp Exp $
*
* Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
*
@ -247,8 +247,6 @@ FcListValueHash (FcValue v)
return FcCharSetCount (v.u.c);
case FcTypeFTFace:
return (FcChar32) v.u.f;
case FcTypePattern:
return (FcChar32) v.u.p->num;
}
return 0;
}

View File

@ -1,5 +1,5 @@
/*
* $XFree86: xc/lib/fontconfig/src/fcmatch.c,v 1.16 2002/07/06 23:47:44 keithp Exp $
* $XFree86: xc/lib/fontconfig/src/fcmatch.c,v 1.17 2002/08/11 18:10:42 keithp Exp $
*
* Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
*
@ -402,8 +402,7 @@ FcFontRenderPrepare (FcConfig *config,
if (!fe)
FcPatternAdd (new, pe->object, pe->values->value, FcTrue);
}
FcPatternAddPattern (new, FC_PATTERN, pat);
FcConfigSubstitute (config, new, FcMatchFont);
FcConfigSubstituteWithPat (config, new, pat, FcMatchFont);
return new;
}

View File

@ -1,5 +1,5 @@
/*
* $XFree86: xc/lib/fontconfig/src/fcname.c,v 1.10 2002/06/29 20:31:02 keithp Exp $
* $XFree86: xc/lib/fontconfig/src/fcname.c,v 1.11 2002/08/11 18:10:42 keithp Exp $
*
* Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
*
@ -472,8 +472,6 @@ FcNameUnparseValue (FcStrBuf *buf,
return FcNameUnparseCharSet (buf, v.u.c);
case FcTypeFTFace:
return FcTrue;
case FcTypePattern:
return FcTrue;
}
return FcFalse;
}

View File

@ -1,5 +1,5 @@
/*
* $XFree86: xc/lib/fontconfig/src/fcpat.c,v 1.12 2002/08/07 01:45:59 keithp Exp $
* $XFree86: xc/lib/fontconfig/src/fcpat.c,v 1.13 2002/08/11 18:10:42 keithp Exp $
*
* Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
*
@ -55,9 +55,6 @@ FcValueDestroy (FcValue v)
case FcTypeCharSet:
FcCharSetDestroy ((FcCharSet *) v.u.c);
break;
case FcTypePattern:
FcPatternDestroy ((FcPattern *) v.u.p);
break;
default:
break;
}
@ -82,9 +79,6 @@ FcValueSave (FcValue v)
if (!v.u.c)
v.type = FcTypeVoid;
break;
case FcTypePattern:
FcPatternReference ((FcPattern *) v.u.p);
break;
default:
break;
}
@ -107,9 +101,6 @@ FcValueListDestroy (FcValueList *l)
case FcTypeCharSet:
FcCharSetDestroy ((FcCharSet *) l->value.u.c);
break;
case FcTypePattern:
FcPatternDestroy ((FcPattern *) l->value.u.p);
break;
default:
break;
}
@ -154,8 +145,6 @@ FcValueEqual (FcValue va, FcValue vb)
return FcCharSetEqual (va.u.c, vb.u.c);
case FcTypeFTFace:
return va.u.f == vb.u.f;
case FcTypePattern:
return FcPatternEqual (va.u.p, vb.u.p);
}
return FcFalse;
}
@ -206,8 +195,6 @@ FcValueHash (FcValue v)
case FcTypeFTFace:
return FcStringHash ((const FcChar8 *) ((FT_Face) v.u.f)->family_name) ^
FcStringHash ((const FcChar8 *) ((FT_Face) v.u.f)->style_name);
case FcTypePattern:
return (FcChar32) v.u.p->num;
}
return FcFalse;
}
@ -459,9 +446,6 @@ bail2:
case FcTypeCharSet:
FcCharSetDestroy ((FcCharSet *) value.u.c);
break;
case FcTypePattern:
FcPatternDestroy ((FcPattern *) value.u.p);
break;
default:
break;
}
@ -579,16 +563,6 @@ FcPatternAddFTFace (FcPattern *p, const char *object, const FT_Face f)
return FcPatternAdd (p, object, v, FcTrue);
}
FcBool
FcPatternAddPattern (FcPattern *p, const char *object, const FcPattern *pp)
{
FcValue v;
v.type = FcTypePattern;
v.u.p = pp;
return FcPatternAdd (p, object, v, FcTrue);
}
FcResult
FcPatternGet (FcPattern *p, const char *object, int id, FcValue *v)
{
@ -730,21 +704,6 @@ FcPatternGetFTFace (FcPattern *p, const char *object, int id, FT_Face *f)
return FcResultMatch;
}
FcResult
FcPatternGetPattern (FcPattern *p, const char *object, int id, FcPattern **pp)
{
FcValue v;
FcResult r;
r = FcPatternGet (p, object, id, &v);
if (r != FcResultMatch)
return r;
if (v.type != FcTypePattern)
return FcResultTypeMismatch;
*pp = (FcPattern *) v.u.p;
return FcResultMatch;
}
FcPattern *
FcPatternDuplicate (FcPattern *orig)
{

View File

@ -1,5 +1,5 @@
/*
* $XFree86: xc/lib/fontconfig/src/fcxml.c,v 1.17 2002/07/31 01:36:37 keithp Exp $
* $XFree86: xc/lib/fontconfig/src/fcxml.c,v 1.18 2002/08/11 18:10:42 keithp Exp $
*
* Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc.
*
@ -25,28 +25,15 @@
#include <stdarg.h>
#include "fcint.h"
#ifndef HAVE_EXPAT
#define HAVE_EXPAT 1
#endif
#ifndef HAVE_XML2
#define HAVE_XML2 0
#endif
#if HAVE_EXPAT
#ifndef HAVE_XMLPARSE_H
#define HAVE_XMLPARSE_H 0
#endif
#if HAVE_XMLPARSE_H
#include <xmlparse.h>
#else
#include <expat.h>
#endif
#endif
#if HAVE_XML2
#include "fclibxml2.h"
#endif
FcTest *
FcTestCreate (FcMatchKind kind,

View File

@ -1,5 +1,5 @@
.\"
.\" $XFree86: xc/lib/fontconfig/src/fontconfig.man,v 1.2 2002/08/06 19:54:10 keithp Exp $
.\" $XFree86: xc/lib/fontconfig/src/fontconfig.man,v 1.3 2002/08/11 18:10:43 keithp Exp $
.\"
.\" Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc.
.\"
@ -865,10 +865,15 @@ void FcConfigAppFontClear (FcConfig *config)
Clears the set of application-specific fonts.
.TP
FcBool FcConfigSubstitute (FcConfig *config, FcPattern *p, FcMatchKind kind)
FcBool FcConfigSubstituteWithPat (FcConfig *config, FcPattern *p, FcPattern *p_pat FcMatchKind kind)
Performs the sequence of pattern modification operations, if 'kind' is
FcMatchPattern, then those tagged as pattern operations are applied, else
if 'kind' is FcMatchFont, those tagged as font operations are applied.
if 'kind' is FcMatchFont, those tagged as font operations are applied and
p_pat is used for <test> elements with target=pattern.
.TP
FcBool FcConfigSubstitute (FcConfig *config, FcPattern *p, FcMatchKind kind)
Calls FcConfigSubstituteWithPat setting p_pat to NULL.
.TP
FcPattern *FcFontMatch (FcConfig *config, FcPattern *p, FcResult *result)
@ -1025,17 +1030,6 @@ Constructs a pattern representing the 'id'th font in 'file'. The number
of fonts in 'file' is returned in 'count'.
.SS XML specific functions
.nf
.B #include <fontconfig/fcxml.h>
.fi
These functions expose the libxml2 datatypes used for font configuration.
.TP
xmlDocPtr FcConfigLoad (const char *file)
Loads a configuration file mapping 'file' into a filename with
FcConfigFilename. This doesn't load a complete configuration as any
include files referenced from 'file' will not be loaded.
.TP
FcBool FcConfigParseAndLoad (FcConfig *config, const FcChar8 *file, FcBool complain)
Walks the configuration in 'file' and constructs the internal representation in