+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
/* 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
/* Define to `int' if <sys/types.h> does not define. */
#undef pid_t
-
-/* Define to the directory containing font configuration files */
-#undef FONTCONFIG_PATH
#
-# $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.
#
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@
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
# 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@
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
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)
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
# Set CONFDIR and FONTCONFIG_PATH
#
-CONFDIR="$sysconfdir/fonts"
-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
-#
-
-case "$expat" in
-maybe)
- ;;
-no)
- xml2=yes
+case "$confdir" in
+no|yes)
+ confdir=/etc/fonts
;;
*)
- xml2=no
;;
esac
+AC_SUBST(confdir)
+CONFDIR='${confdir}'
+AC_DEFINE_UNQUOTED(CONFDIR, "$CONFDIR")
+AC_SUBST(CONFDIR)
-case "$xml2" in
-maybe)
- ;;
-no)
- expat=yes
- ;;
-*)
- expat=no
- ;;
-esac
+#
+# Check expat configuration
+#
case "$expat" in
no)
case "$expat_lib" in
yes)
case "$expat" in
- yes|maybe)
+ yes)
expat_library="-lexpat"
;;
*)
HAVE_EXPAT=1
AC_SUBST(HAVE_EXPAT)
AC_DEFINE_UNQUOTED(HAVE_EXPAT,$HAVE_EXPAT)
- xml2=no
;;
esac
;;
;;
esac
-case "$xml2" 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])
+case "$expat" in
+no)
+ AC_MSG_ERROR([cannot find expat library])
;;
esac
#include "../local.def"
#endif
-INCLUDES=$(FREETYPE2INCLUDES) $(LIBXML2INCLUDES) -I..
+INCLUDES=$(FREETYPE2INCLUDES) -I..
LOCAL_LIBRARIES=FontconfigClientLibs
DEPLIBS=FontconfigClientDepLibs
-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
#
-# $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.
#
# 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
#
-# $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.
#
# PERFORMANCE OF THIS SOFTWARE.
#
# Korean (KO)
+#
+# Coverage from KSC 5601-1992
+#
#0x3000 # IDEOGRAPHIC SPACE
#0x3001 # IDEOGRAPHIC COMMA
#0x3002 # IDEOGRAPHIC FULL STOP
#
-# $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.
#
# 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>
#
-# $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.
#
#
# Chinese in Singapore (ZH-SG)
#
-# Just use GB2312 as for ZH-CH
+# Just use GB2312 as for ZH-CN
include zh_cn.orth
#include "../local.def"
#endif
-INCLUDES=$(FREETYPE2INCLUDES) $(LIBXML2INCLUDES) -I..
+INCLUDES=$(FREETYPE2INCLUDES) -I..
LOCAL_LIBRARIES=FontconfigClientLibs
DEPLIBS=FontconfigClientDepLibs
/*
- * $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.
*
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; \
/*
- * $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.
*
#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"
FcTypeBool,
FcTypeMatrix,
FcTypeCharSet,
- FcTypeFTFace,
- FcTypePattern
+ FcTypeFTFace
} FcType;
typedef struct _FcMatrix {
void
FcConfigAppFontClear (FcConfig *config);
+FcBool
+FcConfigSubstituteWithPat (FcConfig *config,
+ FcPattern *p,
+ FcPattern *p_pat,
+ FcMatchKind kind);
+
FcBool
FcConfigSubstitute (FcConfig *config,
FcPattern *p,
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);
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);
</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'
-->
#include <Threads.tmpl>
-INCLUDES=$(FREETYPE2INCLUDES) $(LIBXML2INCLUDES) -I..
+INCLUDES=$(FREETYPE2INCLUDES) -I..
DEFINES=-DFC_DEFAULT_FONTS='"$(FC_DEFAULT_FONTS)"' -DHAVE_EXPAT
/*
- * $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.
*
#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 *
int size;
int i;
- while ((c = getc (f)) != EOF)
+ while ((c = GETC (f)) != EOF)
if (c == '"')
break;
if (c == EOF)
i = 0;
d = dest;
escape = FcFalse;
- while ((c = getc (f)) != EOF)
+ while ((c = GETC (f)) != EOF)
{
if (!escape)
{
unsigned long t;
int c;
- while ((c = getc (f)) != EOF)
+ while ((c = GETC (f)) != EOF)
{
if (!isspace (c))
break;
if (!isdigit (c))
return FcFalse;
t = t * 10 + (c - '0');
- c = getc (f);
+ c = GETC (f);
}
*dest = t;
return FcTrue;
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;
}
}
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;
}
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;
}
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;
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++)
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;
}
}
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;
}
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)
free (name);
if (!ret)
goto bail3;
- if (putc ('\n', f) == EOF)
+ if (PUTC ('\n', f) == EOF)
goto bail3;
}
/*
- * $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.
*
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
}
FcBool
-FcConfigSubstitute (FcConfig *config,
- FcPattern *p,
- FcMatchKind kind)
+FcConfigSubstituteWithPat (FcConfig *config,
+ FcPattern *p,
+ FcPattern *p_pat,
+ FcMatchKind kind)
{
FcSubst *s;
FcSubState *st;
FcTest *t;
FcEdit *e;
FcValueList *l;
- FcPattern *p_pat = 0;
FcPattern *m;
if (!config)
if (kind == FcMatchPattern)
s = config->substPattern;
else
- {
s = config->substFont;
- (void) FcPatternGetPattern (p, FC_PATTERN, 0, &p_pat);
- }
for (; s; s = s->next)
{
/*
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
/*
- * $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.
*
case FcTypeFTFace:
printf (" face");
break;
- case FcTypePattern:
- printf (" pattern {");
- FcPatternPrint (v.u.p);
- printf (" } ");
- break;
}
}
/*
- * $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.
*
return FcCharSetCount (v.u.c);
case FcTypeFTFace:
return (FcChar32) v.u.f;
- case FcTypePattern:
- return (FcChar32) v.u.p->num;
}
return 0;
}
/*
- * $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.
*
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;
}
/*
- * $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.
*
return FcNameUnparseCharSet (buf, v.u.c);
case FcTypeFTFace:
return FcTrue;
- case FcTypePattern:
- return FcTrue;
}
return FcFalse;
}
/*
- * $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.
*
case FcTypeCharSet:
FcCharSetDestroy ((FcCharSet *) v.u.c);
break;
- case FcTypePattern:
- FcPatternDestroy ((FcPattern *) v.u.p);
- break;
default:
break;
}
if (!v.u.c)
v.type = FcTypeVoid;
break;
- case FcTypePattern:
- FcPatternReference ((FcPattern *) v.u.p);
- break;
default:
break;
}
case FcTypeCharSet:
FcCharSetDestroy ((FcCharSet *) l->value.u.c);
break;
- case FcTypePattern:
- FcPatternDestroy ((FcPattern *) l->value.u.p);
- break;
default:
break;
}
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;
}
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;
}
case FcTypeCharSet:
FcCharSetDestroy ((FcCharSet *) value.u.c);
break;
- case FcTypePattern:
- FcPatternDestroy ((FcPattern *) value.u.p);
- break;
default:
break;
}
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)
{
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)
{
/*
- * $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.
*
#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,
.\"
-.\" $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.
.\"
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)
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