
<refentry id="glXUseXFont">
    <refmeta>
        <refmetainfo>
            <copyright>
                <year>1991-2006</year>
                <holder>Silicon Graphics, Inc.</holder>
            </copyright>
        </refmetainfo>
        <refentrytitle>glXUseXFont</refentrytitle>
        <manvolnum>3G</manvolnum>
    </refmeta>
    <refnamediv>
        <refname>glXUseXFont</refname>
        <refpurpose>create bitmap display lists from an X font</refpurpose>
    </refnamediv>
    <refsynopsisdiv><title>C Specification</title>
        <funcsynopsis>
            <funcprototype>
                <funcdef>void <function>glXUseXFont</function></funcdef>
                <paramdef>Font <parameter>font</parameter></paramdef>
                <paramdef>int <parameter>first</parameter></paramdef>
                <paramdef>int <parameter>count</parameter></paramdef>
                <paramdef>int <parameter>listBase</parameter></paramdef>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>
    <!-- eqn: ignoring delim $$ -->
    <refsect1 id="parameters"><title>Parameters</title>
        <variablelist>
        <varlistentry>
            <term><parameter>font</parameter></term>
            <listitem>
                <para>
                    Specifies the font from which character glyphs are to be taken.
                </para>
            </listitem>
        </varlistentry>
        <varlistentry>
            <term><parameter>first</parameter></term>
            <listitem>
                <para>
                    Specifies the index of the first glyph to be taken.
                </para>
            </listitem>
        </varlistentry>
        <varlistentry>
            <term><parameter>count</parameter></term>
            <listitem>
                <para>
                    Specifies the number of glyphs to be taken.
                </para>
            </listitem>
        </varlistentry>
        <varlistentry>
            <term><parameter>listBase</parameter></term>
            <listitem>
                <para>
                    Specifies the index of the first display list to be generated.
                </para>
            </listitem>
        </varlistentry>
        </variablelist>
    </refsect1>
    <refsect1 id="description"><title>Description</title>
        <para>
            <function>glXUseXFont</function> generates <parameter>count</parameter> display lists,
            named <parameter>listBase</parameter> through 
            <inlineequation><mml:math>
                <!-- eqn: listBase + count - 1:-->
                <mml:mrow>
                    <mml:mi mathvariant="italic">listBase</mml:mi>
                    <mml:mo>+</mml:mo>
                    <mml:mi mathvariant="italic">count</mml:mi>
                    <mml:mo>-</mml:mo>
                    <mml:mn>1</mml:mn>
                </mml:mrow>
            </mml:math></inlineequation>,
            each containing a single <citerefentry><refentrytitle>glBitmap</refentrytitle></citerefentry> command.
            The parameters of the <citerefentry><refentrytitle>glBitmap</refentrytitle></citerefentry> command of display list 
            <inlineequation><mml:math>
                <!-- eqn: listBase + i:-->
                <mml:mrow>
                    <mml:mi mathvariant="italic">listBase</mml:mi>
                    <mml:mo>+</mml:mo>
                    <mml:mi mathvariant="italic">i</mml:mi>
                </mml:mrow>
            </mml:math></inlineequation>
            are derived from glyph 
            <inlineequation><mml:math>
                <!-- eqn: first + i:-->
                <mml:mrow>
                    <mml:mi mathvariant="italic">first</mml:mi>
                    <mml:mo>+</mml:mo>
                    <mml:mi mathvariant="italic">i</mml:mi>
                </mml:mrow>
            </mml:math></inlineequation>.
            Bitmap parameters 
            <inlineequation><mml:math><mml:mi mathvariant="italic">xorig</mml:mi></mml:math></inlineequation>, 
            <inlineequation><mml:math><mml:mi mathvariant="italic">yorig</mml:mi></mml:math></inlineequation>, 
            <inlineequation><mml:math><mml:mi mathvariant="italic">width</mml:mi></mml:math></inlineequation>,
            and 
            <inlineequation><mml:math><mml:mi mathvariant="italic">height</mml:mi></mml:math></inlineequation>
            are computed from font metrics as
            <inlineequation><mml:math>
                <!-- eqn: descent-1:-->
                <mml:mrow>
                    <mml:mi mathvariant="italic">descent</mml:mi>
                    <mml:mo>-</mml:mo>
                    <mml:mn>1</mml:mn>
                </mml:mrow>
            </mml:math></inlineequation>, 
            <inlineequation><mml:math>
                <!-- eqn: -lbearing:-->
                <mml:mrow>
                    <mml:mo>-</mml:mo>
                    <mml:mi mathvariant="italic">lbearing</mml:mi>
                </mml:mrow>
            </mml:math></inlineequation>,
            <inlineequation><mml:math>
                <!-- eqn: rbearing - lbearing:-->
                <mml:mrow>
                    <mml:mi mathvariant="italic">rbearing</mml:mi>
                    <mml:mo>-</mml:mo>
                    <mml:mi mathvariant="italic">lbearing</mml:mi>
                </mml:mrow>
            </mml:math></inlineequation>,
            and 
            <inlineequation><mml:math>
                <!-- eqn: ascent+descent:-->
                <mml:mrow>
                    <mml:mi mathvariant="italic">ascent</mml:mi>
                    <mml:mo>+</mml:mo>
                    <mml:mi mathvariant="italic">descent</mml:mi>
                </mml:mrow>
            </mml:math></inlineequation>,
            respectively.
            <inlineequation><mml:math><mml:mi mathvariant="italic">xmove</mml:mi></mml:math></inlineequation>
            is taken from the glyph's 
            <inlineequation><mml:math><mml:mi mathvariant="italic">width</mml:mi></mml:math></inlineequation>
            metric,
            and 
            <inlineequation><mml:math><mml:mi mathvariant="italic">ymove</mml:mi></mml:math></inlineequation>
            is set to zero.
            Finally,
            the glyph's image is converted to the appropriate format for <citerefentry><refentrytitle>glBitmap</refentrytitle></citerefentry>.
        </para>
        <para>
            Using <function>glXUseXFont</function> may be more efficient than accessing the X font and generating
            the display lists explicitly,
            both because the display lists are created on the server without requiring
            a round trip of the glyph data,
            and because the server may choose to delay the creation of each
            bitmap until it is accessed.
        </para>
        <para>
            Empty display lists are created for all glyphs that are requested and
            are not defined in <parameter>font</parameter>.
            <function>glXUseXFont</function> is ignored if there is no current GLX context.
        </para>
    </refsect1>
    <refsect1 id="errors"><title>Errors</title>
        <para>
            <constant>BadFont</constant> is generated if <parameter>font</parameter> is not a valid font.
        </para>
        <para>
            <constant>GLXBadContextState</constant> is generated if the current GLX context is
            in display-list construction mode.
        </para>
        <para>
            <constant>GLXBadCurrentWindow</constant> is generated if the drawable associated
            with the current context of the calling thread is a window, and that
            window is no longer valid.
        </para>
    </refsect1>
    <refsect1 id="seealso"><title>See Also</title>
        <para>
            <citerefentry><refentrytitle>glBitmap</refentrytitle></citerefentry>,
            <citerefentry><refentrytitle>glXMakeCurrent</refentrytitle></citerefentry>
        </para>
    </refsect1>
    <refsect1 id="Copyright"><title>Copyright</title>
        <para>
            Copyright <trademark class="copyright"></trademark> 1991-2006
            Silicon Graphics, Inc. This document is licensed under the SGI
            Free Software B License. For details, see
            <ulink url="http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/</ulink>.
        </para>
    </refsect1>
</refentry>
