<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
                   "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<!-- lifted from troff+man by doclifter -->
<refentry id='xlistfontman'>
<!--  Copyright \(co 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1994, 1996 X Consortium -->

<!--  Permission is hereby granted, free of charge, to any person obtaining -->
<!--  a copy of this software and associated documentation files (the -->
<!--  "Software"), to deal in the Software without restriction, including -->
<!--  without limitation the rights to use, copy, modify, merge, publish, -->
<!--  distribute, sublicense, and/or sell copies of the Software, and to -->
<!--  permit persons to whom the Software is furnished to do so, subject to -->
<!--  the following conditions: -->

<!--  The above copyright notice and this permission notice shall be included -->
<!--  in all copies or substantial portions of the Software. -->

<!--  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -->
<!--  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -->
<!--  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -->
<!--  IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR -->
<!--  OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -->
<!--  ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -->
<!--  OTHER DEALINGS IN THE SOFTWARE. -->

<!--  Except as contained in this notice, the name of the X Consortium shall -->
<!--  not be used in advertising or otherwise to promote the sale, use or -->
<!--  other dealings in this Software without prior written authorization -->
<!--  from the X Consortium. -->

<!--  Copyright \(co 1985, 1986, 1987, 1988, 1989, 1990, 1991 by -->
<!--  Digital Equipment Corporation -->

<!--  Portions Copyright \(co 1990, 1991 by -->
<!--  Tektronix, Inc. -->

<!--  Permission to use, copy, modify and distribute this documentation for -->
<!--  any purpose and without fee is hereby granted, provided that the above -->
<!--  copyright notice appears in all copies and that both that copyright notice -->
<!--  and this permission notice appear in all copies, and that the names of -->
<!--  Digital and Tektronix not be used in in advertising or publicity pertaining -->
<!--  to this documentation without specific, written prior permission. -->
<!--  Digital and Tektronix makes no representations about the suitability -->
<!--  of this documentation for any purpose. -->
<!--  It is provided ``as is'' without express or implied warranty. -->
<!--   -->
<!--  $XFree86: xc/doc/man/X11/XListFont.man,v 1.3 2003/04/28 22:17:55 herrb Exp $ -->

<!-- .na -->
<!-- Ds listing suppressed (not used) -->
<!-- De listing suppressed (not used) -->
<!-- FD listing suppressed (not used) -->
<!-- FN listing suppressed (not used) -->
<!-- IN listing suppressed (not used) -->
<!-- C{ listing suppressed (not used) -->
<!-- C} listing suppressed (not used) -->
<!-- Pn listing suppressed (not used) -->
<!-- hN listing suppressed (not used) -->
<!-- NT listing suppressed (not used) -->
<!-- .		\" Note End \-\- doug kraft 3/85 -->
<!-- NE listing suppressed (not used) -->
<!-- .ny0 -->
<refmeta>
<refentrytitle>XListFonts</refentrytitle>
<manvolnum>3X11</manvolnum>
<refmiscinfo class='date'>__xorgversion__</refmiscinfo>
<refmiscinfo class='source'>XLIB FUNCTIONS</refmiscinfo>
</refmeta>
<refnamediv id='name'>
<refname>XListFonts</refname>
<refname>XFreeFontNames</refname>
<refname>XListFontsWithInfo</refname>
<refname>XFreeFontInfo</refname>
<refpurpose>obtain or free font names and information</refpurpose>
</refnamediv>
<!-- body begins here -->

<refsect1 id='syntax'><title>SYNTAX</title>

<para>char **XListFonts&hairsp;(&hairsp;Display *&hairsp;<emphasis remap='I'>display</emphasis>&hairsp;, char *&hairsp;<emphasis remap='I'>pattern</emphasis>&hairsp;, int
<emphasis remap='I'>maxnames</emphasis>&hairsp;, int *&hairsp;<emphasis remap='I'>actual_count_return</emphasis>&hairsp;);</para> 

<para>int XFreeFontNames&hairsp;(&hairsp;char *<emphasis remap='I'>list</emphasis>&hairsp;[&hairsp;]&hairsp;);</para> 

<para>char **XListFontsWithInfo&hairsp;(&hairsp;Display *<emphasis remap='I'>display</emphasis>&hairsp;, char *<emphasis remap='I'>pattern</emphasis>&hairsp;,
int <emphasis remap='I'>maxnames</emphasis>&hairsp;, int *<emphasis remap='I'>count_return</emphasis>&hairsp;, XFontStruct
**<emphasis remap='I'>info_return</emphasis>&hairsp;);</para> 

<para>int XFreeFontInfo(&hairsp;char **<emphasis remap='I'>names</emphasis>&hairsp;, XFontStruct *<emphasis remap='I'>free_info</emphasis>, int
<emphasis remap='I'>actual_count</emphasis>&hairsp;);</para> 
</refsect1>

<refsect1 id='arguments'><title>ARGUMENTS</title>
<variablelist remap='IP'>
  <varlistentry>
  <term><emphasis remap='I'>actual_count</emphasis></term>
  <listitem>
<para>Specifies the actual number of font names.</para>

  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>actual_count_return</emphasis></term>
  <listitem>
<para>Returns the actual number of font names.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>count_return</emphasis></term>
  <listitem>
<para>Returns the actual number of matched font names.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>display</emphasis></term>
  <listitem>
<para>Specifies the connection to the X server.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>info_return</emphasis></term>
  <listitem>
<para>Returns the font information.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>free_info</emphasis></term>
  <listitem>
<para>Specifies the font information.</para>

  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>list</emphasis></term>
  <listitem>
<para>Specifies the array of strings you want to free.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>maxnames</emphasis></term>
  <listitem>
<para>Specifies the maximum number of names to be returned.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>names</emphasis></term>
  <listitem>
<para>Specifies the list of font names.</para>

  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>pattern</emphasis></term>
  <listitem>
<para>Specifies the null-terminated pattern string that can contain wildcard 
characters.</para>
  </listitem>
  </varlistentry>
</variablelist>
</refsect1>

<refsect1 id='description'><title>DESCRIPTION</title>
<para>The
<emphasis remap='I'>&hairsp;XListFonts&hairsp;</emphasis>
function returns an array of available font names 
(as controlled by the font search path; see
<emphasis remap='I'>&hairsp;XSetFontPath&hairsp;</emphasis>)
that match the string you passed to the pattern argument.
The pattern string can contain any characters,
but each asterisk (*) is a wildcard for any number of characters,
and each question mark (?) is a wildcard for a single character.
If the pattern string is not in the Host Portable Character Encoding,
the result is implementation-dependent.
Use of uppercase or lowercase does not matter.
Each returned string is null-terminated.
If the data returned by the server is in the Latin Portable Character Encoding,
then the returned strings are in the Host Portable Character Encoding.
Otherwise, the result is implementation-dependent.
If there are no matching font names,
<emphasis remap='I'>&hairsp;XListFonts&hairsp;</emphasis>
returns NULL.
The client should call
<emphasis remap='I'>&hairsp;XFreeFontNames&hairsp;</emphasis>
when finished with the result to free the memory.</para>

<para>The
<emphasis remap='I'>&hairsp;XFreeFontNames&hairsp;</emphasis>
function frees the array and strings returned by
<emphasis remap='I'>&hairsp;XListFonts&hairsp;</emphasis>
or
<emphasis remap='I'>&hairsp;XListFontsWithInfo&hairsp;</emphasis>.</para>

<para>The
<emphasis remap='I'>&hairsp;XListFontsWithInfo&hairsp;</emphasis>
function returns a list of font names that match the specified pattern and their
associated font information.
The list of names is limited to size specified by maxnames.
The information returned for each font is identical to what
<emphasis remap='I'>&hairsp;XLoadQueryFont&hairsp;</emphasis>
would return except that the per-character metrics are not returned.
The pattern string can contain any characters,
but each asterisk (*) is a wildcard for any number of characters,
and each question mark (?) is a wildcard for a single character.
If the pattern string is not in the Host Portable Character Encoding,
the result is implementation-dependent.
Use of uppercase or lowercase does not matter.
Each returned string is null-terminated.
If the data returned by the server is in the Latin Portable Character Encoding,
then the returned strings are in the Host Portable Character Encoding.
Otherwise, the result is implementation-dependent.
If there are no matching font names,
<emphasis remap='I'>&hairsp;XListFontsWithInfo&hairsp;</emphasis>
returns NULL.</para>

<para>To free only the allocated name array,
the client should call
<emphasis remap='I'>&hairsp;XFreeFontNames&hairsp;</emphasis>.
To free both the name array and the font information array
or to free just the font information array,
the client should call
<emphasis remap='I'>&hairsp;XFreeFontInfo&hairsp;</emphasis>.</para>

<para>The
<emphasis remap='I'>&hairsp;XFreeFontInfo&hairsp;</emphasis>
function frees a font structure or an array of font structures
and optionally an array of font names.
If NULL is passed for names, no font names are freed.
If a font structure for an open font (returned by
<emphasis remap='I'>&hairsp;XLoadQueryFont&hairsp;</emphasis>)
is passed, the structure is freed,
but the font is not closed; use
<emphasis remap='I'>&hairsp;XUnloadFont&hairsp;</emphasis>
to close the font.</para>
</refsect1>

<refsect1 id='see_also'><title>SEE ALSO</title>
<para>XLoadFont(3X11),
XSetFontPath(3X11)
<!-- .br -->
<userinput>Xlib - C Language X Interface</userinput></para>
</refsect1>
</refentry>

