diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2010-03-25 21:48:47 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2010-03-25 21:48:47 +0000 |
commit | 1a68a9b7a165123cd605727933898146a409555c (patch) | |
tree | e62c5fedf2ced0b46df77d6b8081789c665bd73b /lib/fontconfig/fc-list | |
parent | 44ff62e966fe9822cb180c33afa7cac44f940d96 (diff) |
Update to fontconfig 2.8.0. Tested on a full ports build by naddy@.
Diffstat (limited to 'lib/fontconfig/fc-list')
-rw-r--r-- | lib/fontconfig/fc-list/Makefile.am | 8 | ||||
-rw-r--r-- | lib/fontconfig/fc-list/Makefile.in | 28 | ||||
-rw-r--r-- | lib/fontconfig/fc-list/fc-list.1 | 53 | ||||
-rw-r--r-- | lib/fontconfig/fc-list/fc-list.c | 118 | ||||
-rw-r--r-- | lib/fontconfig/fc-list/fc-list.sgml | 48 |
5 files changed, 167 insertions, 88 deletions
diff --git a/lib/fontconfig/fc-list/Makefile.am b/lib/fontconfig/fc-list/Makefile.am index ade2835e0..b364271bd 100644 --- a/lib/fontconfig/fc-list/Makefile.am +++ b/lib/fontconfig/fc-list/Makefile.am @@ -1,5 +1,5 @@ # -# $Id: Makefile.am,v 1.5 2009/04/05 16:43:36 matthieu Exp $ +# fontconfig/fc-list/Makefile.am # # Copyright © 2003 Keith Packard # @@ -13,9 +13,9 @@ # representations about the suitability of this software for any purpose. It # is provided "as is" without express or implied warranty. # -# KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, # INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO -# EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR +# EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR # CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, # DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER # TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR @@ -46,7 +46,7 @@ if USEDOCBOOK ${man_MANS}: ${SGML} $(RM) $@ $(DOC2MAN) ${SGML} - $(RM) manpage.refs manpage.links + $(RM) manpage.* all-local: $(man_MANS) diff --git a/lib/fontconfig/fc-list/Makefile.in b/lib/fontconfig/fc-list/Makefile.in index db0ad8613..c4fa6f718 100644 --- a/lib/fontconfig/fc-list/Makefile.in +++ b/lib/fontconfig/fc-list/Makefile.in @@ -15,7 +15,7 @@ @SET_MAKE@ # -# $Id: Makefile.in,v 1.8 2009/04/05 16:43:36 matthieu Exp $ +# fontconfig/fc-list/Makefile.am # # Copyright © 2003 Keith Packard # @@ -29,9 +29,9 @@ # representations about the suitability of this software for any purpose. It # is provided "as is" without express or implied warranty. # -# KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, # INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO -# EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR +# EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR # CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, # DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER # TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR @@ -120,7 +120,6 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ -DOCDIR = @DOCDIR@ DOCMAN3 = @DOCMAN3@ DOCSRC = @DOCSRC@ DOLT_BASH = @DOLT_BASH@ @@ -145,6 +144,7 @@ FC_FONTPATH = @FC_FONTPATH@ FFLAGS = @FFLAGS@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ +GREP = @GREP@ HASDOCBOOK = @HASDOCBOOK@ HAVE_EXPAT = @HAVE_EXPAT@ HAVE_XMLPARSE_H = @HAVE_XMLPARSE_H@ @@ -176,7 +176,6 @@ MS_LIB_AVAILABLE_TRUE = @MS_LIB_AVAILABLE_TRUE@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ -ORTH_FILES = @ORTH_FILES@ OS_WIN32_FALSE = @OS_WIN32_FALSE@ OS_WIN32_TRUE = @OS_WIN32_TRUE@ PACKAGE = @PACKAGE@ @@ -188,6 +187,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ +RM = @RM@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ @@ -196,18 +196,9 @@ USEDOCBOOK_FALSE = @USEDOCBOOK_FALSE@ USEDOCBOOK_TRUE = @USEDOCBOOK_TRUE@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ -ac_ct_AR = @ac_ct_AR@ -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@ -ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ @@ -225,6 +216,9 @@ build_os = @build_os@ build_vendor = @build_vendor@ confdir = @confdir@ datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ exec_prefix = @exec_prefix@ fc_cachedir = @fc_cachedir@ ft_config = @ft_config@ @@ -233,18 +227,22 @@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ ms_librarian = @ms_librarian@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ @@ -583,7 +581,7 @@ uninstall-man: uninstall-man1 @USEDOCBOOK_TRUE@${man_MANS}: ${SGML} @USEDOCBOOK_TRUE@ $(RM) $@ @USEDOCBOOK_TRUE@ $(DOC2MAN) ${SGML} -@USEDOCBOOK_TRUE@ $(RM) manpage.refs manpage.links +@USEDOCBOOK_TRUE@ $(RM) manpage.* @USEDOCBOOK_TRUE@all-local: $(man_MANS) diff --git a/lib/fontconfig/fc-list/fc-list.1 b/lib/fontconfig/fc-list/fc-list.1 index a5f2b2d2f..e0ae9b5f2 100644 --- a/lib/fontconfig/fc-list/fc-list.1 +++ b/lib/fontconfig/fc-list/fc-list.1 @@ -1,40 +1,45 @@ -.\" 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-LIST" "1" "05 May 2008" "" "" - +.\\" auto-generated by docbook2man-spec $Revision: 1.3 $ +.TH "FC-LIST" "1" "Aug 13, 2008" "" "" .SH NAME fc-list \- list available fonts .SH SYNOPSIS +.sp +\fBfc-list\fR [ \fB-vVh\fR ] [ \fB--verbose\fR ] [ \fB [ -f \fIformat\fB ] [ --format \fIformat\fB ] \fR ] [ \fB--version\fR ] [ \fB--help\fR ] -\fBfc-list\fR [ \fB-vV?\fR ] [ \fB--verbose\fR ] [ \fB--version\fR ] [ \fB--help\fR ] [ \fB\fIpattern\fB\fR ] [ \fB\fIelement\fB\fR ] - + [ \fB\fIpattern\fB [ \fIelement\fB\fI...\fB ] \fR ] .SH "DESCRIPTION" .PP \fBfc-list\fR lists fonts and styles available on the system for applications using fontconfig. +If any elements are specified, only those are printed. +Otherwise family and style are printed, unless verbose +output is requested. .SH "OPTIONS" .PP This program follows the usual GNU command line syntax, -with long options starting with two dashes (`-'). A summary of +with long options starting with two dashes (`-'). A summary of options is included below. .TP -\fB-v --verbose \fR -Display status information while busy. +\fB-v\fR +Print verbose output of the whole font pattern for each match, +or \fIelement\fRs if any is +provided. .TP -\fB-? --help \fR -Show summary of options. +\fB-f\fR +Format output according to the format specifier +\fIformat\fR\&. .TP -\fB-V --version \fR +\fB-V\fR Show version of the program and exit. .TP -\fB\fIpattern\fB \fR +\fB-h\fR +Show summary of options. +.TP +\fB\fIpattern\fB\fR If this argument is set, only fonts matching \fIpattern\fR are displayed. .TP -\fB\fIelement\fB \fR +\fB\fIelement\fB\fR If set, the \fIelement\fR property is displayed for matching fonts. .SH "EXAMPLES" @@ -45,13 +50,19 @@ Lists all font faces. \fBfc-list :lang=hi\fR Lists font faces that cover Hindi. .TP -\fBfc-list : family style file spacing \fR +\fBfc-list : family style file spacing\fR Lists the filename and spacing value for each font -face. ``:'' is an empty pattern that matches all +face. ``:'' is an empty pattern that matches all fonts. .SH "SEE ALSO" .PP -\fBfc-cache\fR (1). +\fBfc-match\fR(1) +\fBFcFontList\fR(3) +\fBFcPatternFormat\fR(3) +\fBfc-cat\fR(1) +\fBfc-cache\fR(1) +\fBfc-query\fR(1) +\fBfc-scan\fR(1) .PP The fontconfig user's guide, in HTML format: \fI/usr/share/doc/fontconfig/fontconfig-user.html\fR\&. @@ -59,7 +70,7 @@ The fontconfig user's guide, in HTML format: .PP This manual page was written by Keith Packard <keithp@keithp.com> and Josselin Mouette <joss@debian.org>\&. -...\" $Header: /cvs/OpenBSD/xenocara/lib/fontconfig/fc-list/fc-list.1,v 1.2 2009/04/05 16:43:36 matthieu Exp $ +...\" $Header: /cvs/OpenBSD/xenocara/lib/fontconfig/fc-list/fc-list.1,v 1.3 2010/03/25 21:48:46 matthieu Exp $ ...\" ...\" transcript compatibility for postscript use. ...\" diff --git a/lib/fontconfig/fc-list/fc-list.c b/lib/fontconfig/fc-list/fc-list.c index b85dfd7e4..e7813a6b4 100644 --- a/lib/fontconfig/fc-list/fc-list.c +++ b/lib/fontconfig/fc-list/fc-list.c @@ -1,5 +1,5 @@ /* - * $RCSId: xc/lib/fontconfig/fc-list/fc-list.c,v 1.5 2002/06/30 23:45:40 keithp Exp $ + * fontconfig/fc-list/fc-list.c * * Copyright © 2002 Keith Packard * @@ -13,9 +13,9 @@ * representations about the suitability of this software for any purpose. It * is provided "as is" without express or implied warranty. * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR @@ -26,6 +26,7 @@ #include <stdio.h> #include <unistd.h> #include <stdlib.h> +#include <string.h> #ifdef HAVE_CONFIG_H #include <config.h> #else @@ -47,9 +48,11 @@ #define _GNU_SOURCE #include <getopt.h> const struct option longopts[] = { - {"version", 0, 0, 'V'}, {"verbose", 0, 0, 'v'}, - {"help", 0, 0, '?'}, + {"format", 1, 0, 'f'}, + {"quiet", 0, 0, 'q'}, + {"version", 0, 0, 'V'}, + {"help", 0, 0, 'h'}, {NULL,0,0,0}, }; #else @@ -59,33 +62,42 @@ extern int optind, opterr, optopt; #endif #endif -static void usage (char *program) +static void +usage (char *program, int error) { + FILE *file = error ? stderr : stdout; #if HAVE_GETOPT_LONG - fprintf (stderr, "usage: %s [-vV?] [--verbose] [--version] [--help] [pattern] {element ...} \n", + fprintf (file, "usage: %s [-vqVh] [-f FORMAT] [--verbose] [--format=FORMAT] [--quiet] [--version] [--help] [pattern] {element ...} \n", program); #else - fprintf (stderr, "usage: %s [-vV?] [pattern] {element ...} \n", + fprintf (file, "usage: %s [-vqVh] [-f FORMAT] [pattern] {element ...} \n", program); #endif - fprintf (stderr, "List fonts matching [pattern]\n"); - fprintf (stderr, "\n"); + fprintf (file, "List fonts matching [pattern]\n"); + fprintf (file, "\n"); #if HAVE_GETOPT_LONG - fprintf (stderr, " -v, --verbose display status information while busy\n"); - fprintf (stderr, " -V, --version display font config version and exit\n"); - fprintf (stderr, " -?, --help display this help and exit\n"); + fprintf (file, " -v, --verbose display entire font pattern verbosely\n"); + fprintf (file, " -f, --format=FORMAT use the given output format\n"); + fprintf (file, " -q, --quiet suppress all normal output, exit 1 if no fonts matched\n"); + fprintf (file, " -V, --version display font config version and exit\n"); + fprintf (file, " -h, --help display this help and exit\n"); #else - fprintf (stderr, " -v (verbose) display status information while busy\n"); - fprintf (stderr, " -V (version) display font config version and exit\n"); - fprintf (stderr, " -? (help) display this help and exit\n"); + fprintf (file, " -v (verbose) display entire font pattern verbosely\n"); + fprintf (file, " -f FORMAT (format) use the given output format\n"); + fprintf (file, " -q, (quiet) suppress all normal output, exit 1 if no fonts matched\n"); + fprintf (file, " -V (version) display font config version and exit\n"); + fprintf (file, " -h (help) display this help and exit\n"); #endif - exit (1); + exit (error); } int main (int argc, char **argv) { - /*int verbose = 0;*/ + int verbose = 0; + int quiet = 0; + FcChar8 *format = NULL; + int nfont = 0; int i; FcObjectSet *os = 0; FcFontSet *fs; @@ -94,21 +106,29 @@ main (int argc, char **argv) int c; #if HAVE_GETOPT_LONG - while ((c = getopt_long (argc, argv, "Vv?", longopts, NULL)) != -1) + while ((c = getopt_long (argc, argv, "vf:qVh", longopts, NULL)) != -1) #else - while ((c = getopt (argc, argv, "Vv?")) != -1) + while ((c = getopt (argc, argv, "vf:qVh")) != -1) #endif { switch (c) { + case 'v': + verbose = 1; + break; + case 'f': + format = (FcChar8 *) strdup (optarg); + break; + case 'q': + quiet = 1; + break; case 'V': - fprintf (stderr, "fontconfig version %d.%d.%d\n", + fprintf (stderr, "fontconfig version %d.%d.%d\n", FC_MAJOR, FC_MINOR, FC_REVISION); exit (0); - case 'v': - /* verbose = 1; */ - break; + case 'h': + usage (argv[0], 0); default: - usage (argv[0]); + usage (argv[0], 1); } } i = optind; @@ -133,33 +153,57 @@ main (int argc, char **argv) } else pat = FcPatternCreate (); - - if (!os) + if (quiet && !os) + os = FcObjectSetCreate (); + if (!verbose && !format && !os) os = FcObjectSetBuild (FC_FAMILY, FC_STYLE, (char *) 0); fs = FcFontList (0, pat, os); - FcObjectSetDestroy (os); + if (os) + FcObjectSetDestroy (os); if (pat) FcPatternDestroy (pat); - if (fs) + if (!quiet && fs) { int j; for (j = 0; j < fs->nfont; j++) { - FcChar8 *font; - FcChar8 *file; + if (verbose) + { + FcPatternPrint (fs->fonts[j]); + } + else if (format) + { + FcChar8 *s; + + s = FcPatternFormat (fs->fonts[j], format); + if (s) + { + printf ("%s", s); + free (s); + } + } + else + { + FcChar8 *str; + FcChar8 *file; - font = FcNameUnparse (fs->fonts[j]); - if (FcPatternGetString (fs->fonts[j], FC_FILE, 0, &file) == FcResultMatch) - printf ("%s: ", file); - printf ("%s\n", font); - free (font); + str = FcNameUnparse (fs->fonts[j]); + if (FcPatternGetString (fs->fonts[j], FC_FILE, 0, &file) == FcResultMatch) + printf ("%s: ", file); + printf ("%s\n", str); + free (str); + } } + } + + if (fs) { + nfont = fs->nfont; FcFontSetDestroy (fs); } FcFini (); - return 0; + return quiet ? (nfont == 0 ? 1 : 0) : 0; } diff --git a/lib/fontconfig/fc-list/fc-list.sgml b/lib/fontconfig/fc-list/fc-list.sgml index d0ec733e8..ffa089144 100644 --- a/lib/fontconfig/fc-list/fc-list.sgml +++ b/lib/fontconfig/fc-list/fc-list.sgml @@ -20,7 +20,7 @@ manpage.1: manpage.sgml <!ENTITY dhfirstname "<firstname>Josselin</firstname>"> <!ENTITY dhsurname "<surname>Mouette</surname>"> <!-- Please adjust the date whenever revising the manpage. --> - <!ENTITY dhdate "<date>Sep 16, 2003</date>"> + <!ENTITY dhdate "<date>Aug 13, 2008</date>"> <!-- SECTION should be 1-8, maybe w/ subsection other parameters are allowed: see man(7), man(1). --> <!ENTITY dhsection "<manvolnum>1</manvolnum>"> @@ -63,12 +63,16 @@ manpage.1: manpage.sgml <cmdsynopsis> <command>&dhpackage;</command> - <arg><option>-vV?</option></arg> + <arg><option>-vVh</option></arg> <arg><option>--verbose</option></arg> + <group> + <arg><option>-f</option> <option><replaceable>format</replaceable></option></arg> + <arg><option>--format</option> <option><replaceable>format</replaceable></option></arg> + </group> <arg><option>--version</option></arg> <arg><option>--help</option></arg> - <arg><option><replaceable>pattern</replaceable></option></arg> - <arg><option><replaceable>element</replaceable></option></arg> + <sbr> + <arg><option><replaceable>pattern</replaceable></option> <arg rep="repeat"><option><replaceable>element</replaceable></option></arg> </arg> </cmdsynopsis> </refsynopsisdiv> @@ -76,8 +80,10 @@ manpage.1: manpage.sgml <title>DESCRIPTION</title> <para><command>&dhpackage;</command> lists fonts and styles - available on the system for applications using fontconfig.</para> - + available on the system for applications using fontconfig. + If any elements are specified, only those are printed. + Otherwise family and style are printed, unless verbose + output is requested.</para> </refsect1> <refsect1> <title>OPTIONS</title> @@ -92,15 +98,19 @@ manpage.1: manpage.sgml <option>--verbose</option> </term> <listitem> - <para>Display status information while busy.</para> + <para>Print verbose output of the whole font pattern for each match, + or <replaceable>element</replaceable>s if any is + provided.</para> </listitem> </varlistentry> <varlistentry> - <term><option>-?</option> - <option>--help</option> + <term><option>-f</option> + <option>--format</option> + <option><replaceable>format</replaceable></option> </term> <listitem> - <para>Show summary of options.</para> + <para>Format output according to the format specifier + <replaceable>format</replaceable>.</para> </listitem> </varlistentry> <varlistentry> @@ -112,6 +122,14 @@ manpage.1: manpage.sgml </listitem> </varlistentry> <varlistentry> + <term><option>-h</option> + <option>--help</option> + </term> + <listitem> + <para>Show summary of options.</para> + </listitem> + </varlistentry> + <varlistentry> <term><option><replaceable>pattern</replaceable></option> </term> <listitem> @@ -155,7 +173,15 @@ manpage.1: manpage.sgml <refsect1> <title>SEE ALSO</title> - <para><command>fc-cache</command> (1).</para> + <para> + <command>fc-match</command>(1) + <function>FcFontList</function>(3) + <function>FcPatternFormat</function>(3) + <command>fc-cat</command>(1) + <command>fc-cache</command>(1) + <command>fc-query</command>(1) + <command>fc-scan</command>(1) + </para> <para>The fontconfig user's guide, in HTML format: <filename>/usr/share/doc/fontconfig/fontconfig-user.html</filename>.</para> |