summaryrefslogtreecommitdiff
path: root/lib/fontconfig/fc-match
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2009-04-05 16:43:38 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2009-04-05 16:43:38 +0000
commit18df927f7b9c302f5eb6eaed63a8fdf209c64552 (patch)
treeb949936e4f9abe11692375b4c0567790663b964b /lib/fontconfig/fc-match
parent3f1e1ec27086e513778a2fc86e249a11ab92fe41 (diff)
Update to fontconfig 2.6.0. ok naddy@
this uses a patched version of libtool to fix linking on vax.
Diffstat (limited to 'lib/fontconfig/fc-match')
-rw-r--r--lib/fontconfig/fc-match/Makefile.am14
-rw-r--r--lib/fontconfig/fc-match/Makefile.in38
-rw-r--r--lib/fontconfig/fc-match/fc-match.153
-rw-r--r--lib/fontconfig/fc-match/fc-match.c38
4 files changed, 112 insertions, 31 deletions
diff --git a/lib/fontconfig/fc-match/Makefile.am b/lib/fontconfig/fc-match/Makefile.am
index da7bdf8fc..c555862af 100644
--- a/lib/fontconfig/fc-match/Makefile.am
+++ b/lib/fontconfig/fc-match/Makefile.am
@@ -1,5 +1,5 @@
#
-# $Xorg: Makefile.am,v 1.1.1.1 2006/11/25 18:42:50 matthieu Exp $
+# $Id: Makefile.am,v 1.5 2009/04/05 16:43:36 matthieu Exp $
#
# Copyright © 2003 Keith Packard
#
@@ -29,13 +29,17 @@ FC_MATCH_SRC=${top_srcdir}/fc-match
SGML = ${FC_MATCH_SRC}/fc-match.sgml
-INCLUDES=-I${top_srcdir} $(FREETYPE_CFLAGS) $(WARN_CFLAGS)
+INCLUDES=-I${top_srcdir} $(WARN_CFLAGS)
-EXTRA_DIST=fc-match.sgml
+BUILT_MANS=fc-match.1
-fc_match_LDADD = ${top_builddir}/src/libfontconfig.la $(FREETYPE_LIBS) $(LIBXML2_LIBS) $(EXPAT_LIBS)
+if ENABLE_DOCS
+man_MANS=${BUILT_MANS}
+endif
+
+EXTRA_DIST=fc-match.sgml $(BUILT_MANS)
-man_MANS=fc-match.1
+fc_match_LDADD = ${top_builddir}/src/libfontconfig.la
if USEDOCBOOK
diff --git a/lib/fontconfig/fc-match/Makefile.in b/lib/fontconfig/fc-match/Makefile.in
index 003347c4d..c479d56a5 100644
--- a/lib/fontconfig/fc-match/Makefile.in
+++ b/lib/fontconfig/fc-match/Makefile.in
@@ -15,7 +15,7 @@
@SET_MAKE@
#
-# $Xorg: Makefile.am,v 1.1.1.1 2006/11/25 18:42:50 matthieu Exp $
+# $Id: Makefile.in,v 1.8 2009/04/05 16:43:36 matthieu Exp $
#
# Copyright © 2003 Keith Packard
#
@@ -63,7 +63,8 @@ bin_PROGRAMS = fc-match$(EXEEXT)
subdir = fc-match
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/configure.in
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(install_sh) -d
@@ -74,18 +75,12 @@ binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
PROGRAMS = $(bin_PROGRAMS)
fc_match_SOURCES = fc-match.c
fc_match_OBJECTS = fc-match.$(OBJEXT)
-am__DEPENDENCIES_1 =
-fc_match_DEPENDENCIES = ${top_builddir}/src/libfontconfig.la \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1)
+fc_match_DEPENDENCIES = ${top_builddir}/src/libfontconfig.la
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
@@ -128,6 +123,8 @@ DLLTOOL = @DLLTOOL@
DOCDIR = @DOCDIR@
DOCMAN3 = @DOCMAN3@
DOCSRC = @DOCSRC@
+DOLT_BASH = @DOLT_BASH@
+DSYMUTIL = @DSYMUTIL@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
@@ -160,20 +157,23 @@ LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
+LIBT_CURRENT = @LIBT_CURRENT@
+LIBT_CURRENT_MINUS_AGE = @LIBT_CURRENT_MINUS_AGE@
+LIBT_REVISION = @LIBT_REVISION@
+LIBT_VERSION_INFO = @LIBT_VERSION_INFO@
LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
LIBXML2_LIBS = @LIBXML2_LIBS@
LN_S = @LN_S@
+LTCOMPILE = @LTCOMPILE@
+LTCXXCOMPILE = @LTCXXCOMPILE@
LTLIBOBJS = @LTLIBOBJS@
-LT_CURRENT = @LT_CURRENT@
-LT_CURRENT_MINUS_AGE = @LT_CURRENT_MINUS_AGE@
-LT_REVISION = @LT_REVISION@
-LT_VERSION_INFO = @LT_VERSION_INFO@
MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
MS_LIB_AVAILABLE_FALSE = @MS_LIB_AVAILABLE_FALSE@
MS_LIB_AVAILABLE_TRUE = @MS_LIB_AVAILABLE_TRUE@
+NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
ORTH_FILES = @ORTH_FILES@
@@ -188,6 +188,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
+SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
@@ -200,7 +201,9 @@ ac_ct_AS = @ac_ct_AS@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DLLTOOL = @ac_ct_DLLTOOL@
+ac_ct_DSYMUTIL = @ac_ct_DSYMUTIL@
ac_ct_F77 = @ac_ct_F77@
+ac_ct_NMEDIT = @ac_ct_NMEDIT@
ac_ct_OBJDUMP = @ac_ct_OBJDUMP@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
@@ -249,10 +252,11 @@ target_alias = @target_alias@
DOC2MAN = docbook2man
FC_MATCH_SRC = ${top_srcdir}/fc-match
SGML = ${FC_MATCH_SRC}/fc-match.sgml
-INCLUDES = -I${top_srcdir} $(FREETYPE_CFLAGS) $(WARN_CFLAGS)
-EXTRA_DIST = fc-match.sgml
-fc_match_LDADD = ${top_builddir}/src/libfontconfig.la $(FREETYPE_LIBS) $(LIBXML2_LIBS) $(EXPAT_LIBS)
-man_MANS = fc-match.1
+INCLUDES = -I${top_srcdir} $(WARN_CFLAGS)
+BUILT_MANS = fc-match.1
+@ENABLE_DOCS_TRUE@man_MANS = ${BUILT_MANS}
+EXTRA_DIST = fc-match.sgml $(BUILT_MANS)
+fc_match_LDADD = ${top_builddir}/src/libfontconfig.la
all: all-am
.SUFFIXES:
diff --git a/lib/fontconfig/fc-match/fc-match.1 b/lib/fontconfig/fc-match/fc-match.1
index 4bd79b180..a57d62e57 100644
--- a/lib/fontconfig/fc-match/fc-match.1
+++ b/lib/fontconfig/fc-match/fc-match.1
@@ -1,4 +1,55 @@
-...\" $Header: /cvs/OpenBSD/xenocara/lib/fontconfig/fc-match/fc-match.1,v 1.1 2007/05/05 10:32:29 matthieu Exp $
+.\" This manpage has been automatically generated by docbook2man
+.\" from a DocBook document. This tool can be found at:
+.\" <http://shell.ipoline.com/~elmert/comp/docbook2X/>
+.\" Please send any bug reports, improvements, comments, patches,
+.\" etc. to Steve Cheng <steve@ggi-project.org>.
+.TH "FC-MATCH" "1" "05 May 2008" "" ""
+
+.SH NAME
+fc-match \- match available fonts
+.SH SYNOPSIS
+
+\fBfc-match\fR [ \fB-svV?\fR ] [ \fB--sort\fR ] [ \fB--verbose\fR ] [ \fB--version\fR ] [ \fB--help\fR ] [ \fB\fIfont-pattern\fB\fR ]
+
+.SH "DESCRIPTION"
+.PP
+\fBfc-match\fR matches font-pattern (empty
+pattern by default) using the normal fontconfig matching rules to find
+the best font available. If --sort is given, the sorted list of best
+matching fonts is displayed. With --verbose, the whole font pattern
+for each match is printed, otherwise only the file, family and style
+are printed..
+.SH "OPTIONS"
+.PP
+This program follows the usual GNU command line syntax,
+with long options starting with two dashes (`-'). A summary of
+options is included below.
+.TP
+\fB-v --verbose \fR
+Print whole font pattern for each match.
+.TP
+\fB-? --help \fR
+Show summary of options.
+.TP
+\fB-V --version \fR
+Show version of the program and exit.
+.TP
+\fB-s --sort \fR
+Displays sorted list of best matching fonts.
+.TP
+\fB\fIfont-pattern\fB \fR
+Displays fonts matching
+\fIfont-pattern\fR (uses empty pattern by default).
+.SH "SEE ALSO"
+.PP
+\fBfc-list\fR (1).
+.PP
+The fontconfig user's guide, in HTML format:
+\fI/usr/share/doc/fontconfig/fontconfig-user.html\fR\&.
+.SH "AUTHOR"
+.PP
+This manual page was updated by Patrick Lam <plam@csail.mit.edu>\&.
+...\" $Header: /cvs/OpenBSD/xenocara/lib/fontconfig/fc-match/fc-match.1,v 1.2 2009/04/05 16:43:36 matthieu Exp $
...\"
...\" transcript compatibility for postscript use.
...\"
diff --git a/lib/fontconfig/fc-match/fc-match.c b/lib/fontconfig/fc-match/fc-match.c
index 5f36f004f..aadd08aa5 100644
--- a/lib/fontconfig/fc-match/fc-match.c
+++ b/lib/fontconfig/fc-match/fc-match.c
@@ -50,6 +50,7 @@
#include <getopt.h>
static const struct option longopts[] = {
{"sort", 0, 0, 's'},
+ {"all", 0, 0, 'a'},
{"version", 0, 0, 'V'},
{"verbose", 0, 0, 'v'},
{"help", 0, 0, '?'},
@@ -65,7 +66,7 @@ extern int optind, opterr, optopt;
static void usage (char *program)
{
#if HAVE_GETOPT_LONG
- fprintf (stderr, "usage: %s [-svV?] [--sort] [--verbose] [--version] [--help] [pattern]\n",
+ fprintf (stderr, "usage: %s [-svV?] [--sort] [--all] [--verbose] [--version] [--help] [pattern]\n",
program);
#else
fprintf (stderr, "usage: %s [-svV?] [pattern]\n",
@@ -75,11 +76,13 @@ static void usage (char *program)
fprintf (stderr, "\n");
#if HAVE_GETOPT_LONG
fprintf (stderr, " -s, --sort display sorted list of matches\n");
+ fprintf (stderr, " -a, --all display unpruned sorted list of matches\n");
fprintf (stderr, " -v, --verbose display entire font pattern\n");
fprintf (stderr, " -V, --version display font config version and exit\n");
fprintf (stderr, " -?, --help display this help and exit\n");
#else
fprintf (stderr, " -s, (sort) display sorted list of matches\n");
+ fprintf (stderr, " -a (all) display unpruned sorted list of matches\n");
fprintf (stderr, " -v (verbose) display entire font pattern\n");
fprintf (stderr, " -V (version) display font config version and exit\n");
fprintf (stderr, " -? (help) display this help and exit\n");
@@ -91,7 +94,7 @@ int
main (int argc, char **argv)
{
int verbose = 0;
- int sort = 0;
+ int sort = 0, all = 0;
int i;
FcFontSet *fs;
FcPattern *pat;
@@ -100,12 +103,15 @@ main (int argc, char **argv)
int c;
#if HAVE_GETOPT_LONG
- while ((c = getopt_long (argc, argv, "sVv?", longopts, NULL)) != -1)
+ while ((c = getopt_long (argc, argv, "asVv?", longopts, NULL)) != -1)
#else
- while ((c = getopt (argc, argv, "sVv?")) != -1)
+ while ((c = getopt (argc, argv, "asVv?")) != -1)
#endif
{
switch (c) {
+ case 'a':
+ all = 1;
+ break;
case 's':
sort = 1;
break;
@@ -141,12 +147,28 @@ main (int argc, char **argv)
FcConfigSubstitute (0, pat, FcMatchPattern);
FcDefaultSubstitute (pat);
- if (sort)
- fs = FcFontSort (0, pat, FcTrue, 0, &result);
+ fs = FcFontSetCreate ();
+
+ if (sort || all)
+ {
+ FcFontSet *font_patterns;
+ int j;
+ font_patterns = FcFontSort (0, pat, all ? FcFalse : FcTrue, 0, &result);
+
+ for (j = 0; j < font_patterns->nfont; j++)
+ {
+ FcPattern *font_pattern;
+
+ font_pattern = FcFontRenderPrepare (NULL, pat, font_patterns->fonts[j]);
+ if (font_pattern)
+ FcFontSetAdd (fs, font_pattern);
+ }
+
+ FcFontSetSortDestroy (font_patterns);
+ }
else
{
FcPattern *match;
- fs = FcFontSetCreate ();
match = FcFontMatch (0, pat, &result);
if (match)
FcFontSetAdd (fs, match);
@@ -180,7 +202,7 @@ main (int argc, char **argv)
if (FcPatternGetString (fs->fonts[j], FC_FAMILY, 0, &family) != FcResultMatch)
family = (FcChar8 *) "<unknown family>";
if (FcPatternGetString (fs->fonts[j], FC_STYLE, 0, &style) != FcResultMatch)
- file = (FcChar8 *) "<unknown style>";
+ style = (FcChar8 *) "<unknown style>";
printf ("%s: \"%s\" \"%s\"\n", file, family, style);
}