1204 lines
21 KiB
HTML
1204 lines
21 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of Xft</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>Xft</H1>
|
|
Section: C Library Functions (3)<BR>Updated: libXft 2.3.3<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
<BR> Xft - X FreeType interface library
|
|
<A NAME="lbAC"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
<B>Xft</B>
|
|
|
|
is a simple library designed to interface the FreeType rasterizer with the X
|
|
Rendering Extension.
|
|
This manual page barely scratches the surface of this library.
|
|
<A NAME="lbAD"> </A>
|
|
<H2>HEADER FILE</H2>
|
|
|
|
<B>#include <<A HREF="file:///usr/include/X11/Xft/Xft.h">X11/Xft/Xft.h</A>></B>
|
|
|
|
<A NAME="lbAE"> </A>
|
|
<H2>CONSTANTS</H2>
|
|
|
|
<DL COMPACT>
|
|
<DT id="1"><B>XFT_MAJOR</B>
|
|
|
|
<DD>
|
|
is the major version number of
|
|
<B>Xft</B>.
|
|
|
|
<DT id="2"><B>XFT_MINOR</B>
|
|
|
|
<DD>
|
|
is the minor version number of
|
|
<B>Xft</B>.
|
|
|
|
<DT id="3"><B>XFT_REVISION</B>
|
|
|
|
<DD>
|
|
is the revision number of
|
|
<B>Xft</B>.
|
|
|
|
<DT id="4"><B>XFT_VERSION</B>
|
|
|
|
<DD>
|
|
is
|
|
<B>XFT_MAJOR</B>
|
|
|
|
times 10000 (ten thousand), plus
|
|
<B>XFT_MINOR</B>
|
|
|
|
times 100, plus
|
|
<B>XFT_REVISION</B>.
|
|
|
|
<DT id="5"><B>XftVersion</B>
|
|
|
|
<DD>
|
|
is an alias for
|
|
<B>XFT_VERSION</B>.
|
|
|
|
</DL>
|
|
<P>
|
|
|
|
The following example illustrates how
|
|
<B>Xft</B>'s
|
|
|
|
version constants might be used:
|
|
<PRE>
|
|
#if (XFT_VERSION >= 20107)
|
|
(void) puts("Version 2.1.7 or later of the Xft library is in"
|
|
" use.");
|
|
#else
|
|
(void) printf("Insufficient version of Xft (%d.%d.%d) installed;
|
|
" need at least version 2.1.7.\n", XFT_MAJOR,
|
|
XFT_MINOR,
|
|
XFT_REVISION);
|
|
#endif
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAF"> </A>
|
|
<H2>DATA TYPES</H2>
|
|
|
|
<DL COMPACT>
|
|
<DT id="6"><B>XftFont</B>
|
|
|
|
<DD>
|
|
<PRE>
|
|
typedef struct _XftFont {
|
|
int ascent;
|
|
int descent;
|
|
int height;
|
|
int max_advance_width;
|
|
FcCharSet *charset;
|
|
FcPattern *pattern;
|
|
} XftFont;
|
|
</PRE>
|
|
|
|
An
|
|
<B>XftFont</B>
|
|
|
|
is the primary data structure of interest to programmers using
|
|
<B>Xft</B>;
|
|
|
|
it contains general font metrics and pointers to the Fontconfig
|
|
character set and pattern associated with the font.
|
|
The
|
|
<B>FcCharSet</B>
|
|
|
|
and
|
|
<B>FcPattern</B>
|
|
|
|
data types are defined by the Fontconfig library.
|
|
<DT id="7"><B></B>
|
|
|
|
<DD>
|
|
<B>XftFont</B>s
|
|
|
|
are populated with any of
|
|
<B>XftFontOpen</B>(),
|
|
|
|
<B>XftFontOpenName</B>(),
|
|
|
|
<B>XftFontOpenXlfd</B>(),
|
|
|
|
<B>XftFontOpenInfo</B>(),
|
|
|
|
or
|
|
<B>XftFontOpenPattern</B>().
|
|
|
|
<B>XftFontCopy</B>()
|
|
|
|
is used to duplicate
|
|
<B>XftFont</B>s,
|
|
|
|
and
|
|
<B>XftFontClose</B>()
|
|
|
|
is used to mark an
|
|
<B>XftFont</B>
|
|
|
|
as unused.
|
|
<B>XftFont</B>s
|
|
|
|
are internally allocated, reference-counted, and freed by
|
|
<B>Xft</B>;
|
|
|
|
the programmer does not ordinarily need to allocate or free storage
|
|
for them.
|
|
<DT id="8"><B></B>
|
|
|
|
<DD>
|
|
<B>XftDrawGlyphs</B>(),
|
|
|
|
the
|
|
<B>XftDrawString</B>*()
|
|
|
|
family,
|
|
<B>XftDrawCharSpec</B>(),
|
|
|
|
and
|
|
<B>XftDrawGlyphSpec</B>()
|
|
|
|
use
|
|
<B>XftFont</B>s
|
|
|
|
to render text to an
|
|
<B>XftDraw</B>
|
|
|
|
object, which may correspond to either a core X drawable or an X
|
|
Rendering Extension drawable.
|
|
<DT id="9"><B></B>
|
|
|
|
<DD>
|
|
<B>XftGlyphExtents</B>()
|
|
|
|
and the
|
|
<B>XftTextExtents</B>*()
|
|
|
|
family are used to determine the extents (maximum dimensions) of an
|
|
<B>XftFont</B>.
|
|
|
|
<DT id="10"><B></B>
|
|
|
|
<DD>
|
|
An
|
|
<B>XftFont</B>'s
|
|
|
|
glyph or character coverage can be determined with
|
|
<B>XftFontCheckGlyph</B>()
|
|
|
|
or
|
|
<B>XftCharExists</B>().
|
|
|
|
<B>XftCharIndex</B>()
|
|
|
|
returns the
|
|
<B>XftFont</B>-specific
|
|
|
|
character index corresponding to a given Unicode codepoint.
|
|
<DT id="11"><B></B>
|
|
|
|
<DD>
|
|
<B>XftGlyphRender</B>(),
|
|
|
|
<B>XftGlyphSpecRender</B>(),
|
|
|
|
<B>XftCharSpecRender</B>(),
|
|
|
|
and the
|
|
<B>XftTextRender</B>*()
|
|
|
|
family use
|
|
<B>XftFont</B>s
|
|
|
|
to draw into X Rendering Extension
|
|
<B>Picture</B>
|
|
|
|
structures.
|
|
<B>Note:</B>
|
|
|
|
<B>XftDrawGlyphs</B>(),
|
|
|
|
the
|
|
<B>XftDrawString</B>*()
|
|
|
|
family,
|
|
<B>XftDrawCharSpec</B>(),
|
|
|
|
and
|
|
<B>XftDrawGlyphSpec</B>()
|
|
|
|
provide a means of rendering fonts that is independent of the
|
|
availability of the X Rendering Extension on the X server.
|
|
|
|
|
|
|
|
|
|
<DT id="12"><B>XftFontInfo</B>
|
|
|
|
<DD>
|
|
is an opaque object that stores information about a font.
|
|
<B>XftFontInfo</B>
|
|
|
|
structures are created with
|
|
<B>XftFontInfoCreate</B>(),
|
|
|
|
freed with
|
|
<B>XftFontInfoDestroy</B>(),
|
|
|
|
and compared with
|
|
<B>XftFontInfoEqual</B>().
|
|
|
|
<B>XftFontInfo</B>
|
|
|
|
objects are internally allocated and freed by
|
|
<B>Xft</B>;
|
|
|
|
the programmer does not ordinarily need to allocate or free storage
|
|
for them.
|
|
<DT id="13"><B></B>
|
|
|
|
<DD>
|
|
Each
|
|
<B>XftFontInfo</B>
|
|
|
|
structure in use is associated with a unique identifier, which can be
|
|
retrieved with
|
|
<B>XftFontInfoHash</B>().
|
|
|
|
An
|
|
<B>XftFont</B>
|
|
|
|
can be opened based on
|
|
<B>XftFontInfo</B>
|
|
|
|
data with
|
|
<B>XftFontOpenInfo</B>().
|
|
|
|
<DT id="14"><B>XftColor</B>
|
|
|
|
<DD>
|
|
<PRE>
|
|
typedef struct _XftColor {
|
|
unsigned long pixel;
|
|
XRenderColor color;
|
|
} XftColor;
|
|
</PRE>
|
|
|
|
An
|
|
<B>XftColor</B>
|
|
|
|
object permits text and other items to be rendered in a particular
|
|
color (or the closest approximation offered by the X visual in use).
|
|
The
|
|
<B>XRenderColor</B>
|
|
|
|
data type is defined by the X Render Extension library.
|
|
<DT id="15"><B></B>
|
|
|
|
<DD>
|
|
<B>XftColorAllocName</B>()
|
|
|
|
and
|
|
<B>XftColorAllocValue</B>()
|
|
|
|
request a color allocation from the X server (if necessary) and
|
|
initialize the members of
|
|
<B>XftColor</B>.
|
|
|
|
<B>XftColorFree</B>()
|
|
|
|
instructs the X server to free the color currently allocated for an
|
|
<B>XftColor</B>.
|
|
|
|
<DT id="16"><B></B>
|
|
|
|
<DD>
|
|
One an
|
|
<B>XftColor</B>
|
|
|
|
has been initialized,
|
|
<B>XftDrawSrcPicture</B>(),
|
|
|
|
<B>XftDrawGlyphs</B>(),
|
|
|
|
the
|
|
<B>XftDrawString</B>*()
|
|
|
|
family,
|
|
<B>XftDrawCharSpec</B>(),
|
|
|
|
<B>XftDrawCharFontSpec</B>(),
|
|
|
|
<B>XftDrawGlyphSpec</B>(),
|
|
|
|
<B>XftDrawGlyphFontSpec</B>(),
|
|
|
|
and
|
|
<B>XftDrawRect</B>()
|
|
|
|
may be used to draw various objects using it.
|
|
<DT id="17"><B>XftDraw</B>
|
|
|
|
<DD>
|
|
is an opaque object which holds information used to render to an X drawable
|
|
using either the core protocol or the X Rendering extension.
|
|
<DT id="18"><B></B>
|
|
|
|
<DD>
|
|
<B>XftDraw</B>
|
|
|
|
objects are created with any of
|
|
<B>XftDrawCreate</B>()
|
|
|
|
(which associates an
|
|
<B>XftDraw</B>
|
|
|
|
with an existing X drawable),
|
|
<B>XftDrawCreateBitmap</B>(),
|
|
|
|
or
|
|
<B>XftDrawCreateAlpha</B>(),
|
|
|
|
and destroyed with
|
|
<B>XftDrawDestroy</B>().
|
|
|
|
The X drawable associated with an
|
|
<B>XftDraw</B>
|
|
|
|
can be changed with
|
|
<B>XftDrawChange</B>().
|
|
|
|
<B>XftDraw</B>s
|
|
|
|
are internally allocated and freed by
|
|
<B>Xft</B>;
|
|
|
|
the programmer does not ordinarily need to allocate or free storage
|
|
for them.
|
|
<DT id="19"><B></B>
|
|
|
|
<DD>
|
|
The X
|
|
<B>Display</B>,
|
|
|
|
<B>Drawable</B>,
|
|
|
|
<B>Colormap</B>,
|
|
|
|
and
|
|
<B>Visual</B>
|
|
|
|
of an
|
|
<B>XftDraw</B>
|
|
|
|
can be queried with
|
|
<B>XftDrawDisplay</B>(),
|
|
|
|
<B>XftDrawDrawable</B>(),
|
|
|
|
<B>XftDrawColormap</B>(),
|
|
|
|
and
|
|
<B>XftDrawVisual</B>(),
|
|
|
|
respectively.
|
|
The X Rendering Extension
|
|
<B>Picture</B>
|
|
|
|
associated with an
|
|
<B>XftDraw</B>
|
|
|
|
is returned by
|
|
<B>XftDrawPicture</B>().
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<DT id="20"><B>XftCharSpec</B>
|
|
|
|
<DD>
|
|
<PRE>
|
|
typedef struct _XftCharSpec {
|
|
FcChar32 ucs4;
|
|
short x;
|
|
short y;
|
|
} XftCharSpec;
|
|
</PRE>
|
|
|
|
<DT id="21"><B></B>
|
|
|
|
<DD>
|
|
The
|
|
<B>FcChar32</B>
|
|
|
|
data type is defined by the Fontconfig library.
|
|
|
|
|
|
<DT id="22"><B>XftCharFontSpec</B>
|
|
|
|
<DD>
|
|
<PRE>
|
|
typedef struct _XftCharFontSpec {
|
|
XftFont *font;
|
|
FcChar32 ucs4;
|
|
short x;
|
|
short y;
|
|
} XftCharFontSpec;
|
|
</PRE>
|
|
|
|
<DT id="23"><B></B>
|
|
|
|
<DD>
|
|
The
|
|
<B>FcChar32</B>
|
|
|
|
data type is defined by the Fontconfig library.
|
|
|
|
|
|
<DT id="24"><B>XftGlyphSpec</B>
|
|
|
|
<DD>
|
|
<PRE>
|
|
typedef struct _XftGlyphSpec {
|
|
FT_UInt glyph;
|
|
short x;
|
|
short y;
|
|
} XftGlyphSpec;
|
|
</PRE>
|
|
|
|
<DT id="25"><B></B>
|
|
|
|
<DD>
|
|
The
|
|
<B>FT_UInt</B>
|
|
|
|
data type is defined by the FreeType library.
|
|
|
|
|
|
<DT id="26"><B>XftGlyphFontSpec</B>
|
|
|
|
<DD>
|
|
<PRE>
|
|
typedef struct _XftGlyphFontSpec {
|
|
XftFont *font;
|
|
FT_UInt glyph;
|
|
short x;
|
|
short y;
|
|
} XftGlyphFontSpec;
|
|
</PRE>
|
|
|
|
<DT id="27"><B></B>
|
|
|
|
<DD>
|
|
The
|
|
<B>FT_UInt</B>
|
|
|
|
data type is defined by the FreeType library.
|
|
|
|
|
|
</DL>
|
|
<A NAME="lbAG"> </A>
|
|
<H2>FUNCTIONS</H2>
|
|
|
|
<A NAME="lbAH"> </A>
|
|
<H3>Opening and Matching Fonts</H3>
|
|
|
|
<PRE>
|
|
<B>XftFont *</B>
|
|
<B>XftFontOpen (Display *</B><I>dpy</I><B>,</B>
|
|
<B> int </B><I>screen</I><B>,</B>
|
|
<B> ...);</B>
|
|
</PRE>
|
|
|
|
<B>XftFontOpen</B>
|
|
|
|
takes a list of pattern element triples of the form
|
|
<I>field</I>,<I> type</I>,<I> value</I>
|
|
|
|
(terminated with a NULL), matches that pattern against the available fonts,
|
|
and opens the matching font, sizing it correctly for screen number
|
|
<I>screen</I>
|
|
|
|
on display
|
|
<I>dpy</I>.
|
|
|
|
The
|
|
<B>Display</B>
|
|
|
|
data type is defined by the X11 library.
|
|
Returns NULL if no match is found.
|
|
<P>
|
|
|
|
Example:
|
|
<PRE>
|
|
font = XftFontOpen (dpy, screen,
|
|
XFT_FAMILY, XftTypeString, "charter",
|
|
XFT_SIZE, XftTypeDouble, 12.0,
|
|
NULL);
|
|
</PRE>
|
|
|
|
This opens the "charter" font at 12 points.
|
|
The point size is automatically converted to the correct pixel size based
|
|
on the resolution of the monitor.
|
|
<P>
|
|
|
|
<PRE>
|
|
<B>XftFont *</B>
|
|
<B>XftFontOpenName (Display *</B><I>dpy</I><B>,</B>
|
|
<B> int </B><I>screen</I><B>,</B>
|
|
<B> unsigned char *</B><I>name</I><B>);</B>
|
|
</PRE>
|
|
|
|
<B>XftFontOpenName</B>
|
|
|
|
behaves as
|
|
<B>XftFontOpen</B>
|
|
|
|
does, except that it takes a Fontconfig pattern string (which is passed to
|
|
the Fontconfig library's
|
|
<B>FcNameParse</B>()
|
|
|
|
function).
|
|
<P>
|
|
|
|
<PRE>
|
|
<B>XftFont *</B>
|
|
<B>XftFontOpenXlfd (Display *</B><I>dpy</I><B>,</B>
|
|
<B> int </B><I>screen</I><B>,</B>
|
|
<B> unsigned char *</B><I>xlfd</I><B>)</B>
|
|
</PRE>
|
|
|
|
<B>XftFontOpenXlfd</B>
|
|
|
|
behaves as
|
|
<B>XftFontOpen</B>
|
|
|
|
does, except that it takes a string containing an X Logical Font
|
|
Description (XLFD).
|
|
<P>
|
|
|
|
<PRE>
|
|
<B>FcPattern *</B>
|
|
<B>XftFontMatch (Display *</B><I>dpy</I><B>,</B>
|
|
<B> int </B><I>screen</I><B>,</B>
|
|
<B> FcPattern *</B><I>pattern</I><B>,</B>
|
|
<B> FcResult *</B><I>result</I><B>);</B>
|
|
</PRE>
|
|
|
|
Also used internally by the
|
|
<B>XftFontOpen</B>*
|
|
|
|
functions,
|
|
<B>XftFontMatch</B>
|
|
|
|
can also be used directly to determine the Fontconfig font pattern
|
|
resulting from an Xft font open request.
|
|
The
|
|
<B>FcPattern</B>
|
|
|
|
and
|
|
<B>FcResult</B>
|
|
|
|
data types are defined by the Fontconfig library.
|
|
<A NAME="lbAI"> </A>
|
|
<H3>Determining the Pixel Extents of a Text String</H3>
|
|
|
|
<PRE>
|
|
<B>void</B>
|
|
<B>XftTextExtents8 (Display *</B><I>dpy</I><B>,</B>
|
|
<B> XftFont *</B><I>font</I><B>,</B>
|
|
<B> FcChar8 *</B><I>string</I><B>,</B>
|
|
<B> int </B><I>len</I><B>,</B>
|
|
<B> XGlyphInfo *</B><I>extents</I><B>);</B>
|
|
</PRE>
|
|
|
|
<B>XftTextExtents8</B>
|
|
|
|
computes the pixel extents on display
|
|
<I>dpy</I>
|
|
|
|
of no more than
|
|
<I>len</I>
|
|
|
|
glyphs of a
|
|
<I>string</I>
|
|
|
|
consisting of eight-bit characters when drawn with
|
|
<I>font</I>,
|
|
|
|
storing them in
|
|
<I>extents</I>.
|
|
|
|
The
|
|
<B>FcChar8</B>
|
|
|
|
data type is defined by the Fontconfig library, and the
|
|
<B>XGlyphInfo</B>
|
|
|
|
data type is defined by the X Rendering Extension library.
|
|
<P>
|
|
|
|
<PRE>
|
|
<B>void</B>
|
|
<B>XftTextExtents16 (Display *</B><I>dpy</I><B>,</B>
|
|
<B> XftFont *</B><I>font</I><B>,</B>
|
|
<B> FcChar16 *</B><I>string</I><B>,</B>
|
|
<B> int </B><I>len</I><B>,</B>
|
|
<B> XGlyphInfo *</B><I>extents</I><B>);</B>
|
|
</PRE>
|
|
|
|
<B>XftTextExtents16</B>
|
|
|
|
computes the pixel extents on display
|
|
<I>dpy</I>
|
|
|
|
of no more than
|
|
<I>len</I>
|
|
|
|
glyphs of a
|
|
<I>string</I>
|
|
|
|
consisting of sixteen-bit characters when drawn with
|
|
<I>font</I>,
|
|
|
|
storing them in
|
|
<I>extents</I>.
|
|
|
|
The
|
|
<B>FcChar16</B>
|
|
|
|
data type is defined by the Fontconfig library, and the
|
|
<B>XGlyphInfo</B>
|
|
|
|
data type is defined by the X Rendering Extension library.
|
|
<P>
|
|
|
|
<PRE>
|
|
<B>void</B>
|
|
<B>XftTextExtents32 (Display *</B><I>dpy</I><B>,</B>
|
|
<B> XftFont *</B><I>font</I><B>,</B>
|
|
<B> FcChar32 *</B><I>string</I><B>,</B>
|
|
<B> int </B><I>len</I><B>,</B>
|
|
<B> XGlyphInfo *</B><I>extents</I><B>);</B>
|
|
</PRE>
|
|
|
|
<B>XftTextExtents32</B>
|
|
|
|
computes the pixel extents on display
|
|
<I>dpy</I>
|
|
|
|
of no more than
|
|
<I>len</I>
|
|
|
|
glyphs of a
|
|
<I>string</I>
|
|
|
|
consisting of thirty-two-bit characters when drawn with
|
|
<I>font</I>,
|
|
|
|
storing them in
|
|
<I>extents</I>.
|
|
|
|
The
|
|
<B>FcChar32</B>
|
|
|
|
data type is defined by the Fontconfig library, and the
|
|
<B>XGlyphInfo</B>
|
|
|
|
data type is defined by the X Rendering Extension library.
|
|
<P>
|
|
|
|
<PRE>
|
|
<B>void</B>
|
|
<B>XftTextExtentsUtf8 (Display *</B><I>dpy</I><B>,</B>
|
|
<B> XftFont *</B><I>font</I><B>,</B>
|
|
<B> FcChar8 *</B><I>string</I><B>,</B>
|
|
<B> int </B><I>len</I><B>,</B>
|
|
<B> XGlyphInfo *</B><I>extents</I><B>);</B>
|
|
</PRE>
|
|
|
|
<B>XftTextExtentsUtf8</B>
|
|
|
|
computes the pixel extents on display
|
|
<I>dpy</I>
|
|
|
|
of no more than
|
|
<I>len</I>
|
|
|
|
bytes of a UTF-8 encoded
|
|
<I>string</I>
|
|
|
|
when drawn with
|
|
<I>font</I>,
|
|
|
|
storing them in
|
|
<I>extents</I>.
|
|
|
|
The
|
|
<B>XGlyphInfo</B>
|
|
|
|
data type is defined by the X Rendering Extension library.
|
|
<P>
|
|
|
|
<PRE>
|
|
<B>void</B>
|
|
<B>XftTextExtentsUtf16 (Display *</B><I>dpy</I><B>,</B>
|
|
<B> XftFont *</B><I>font</I><B>,</B>
|
|
<B> FcChar8 *</B><I>string</I><B>,</B>
|
|
<B> FcEndian </B><I>endian</I><B>,</B>
|
|
<B> int </B><I>len</I><B>,</B>
|
|
<B> XGlyphInfo *</B><I>extents</I><B>);</B>
|
|
</PRE>
|
|
|
|
<B>XftTextExtentsUtf16</B>
|
|
|
|
computes the pixel extents on display
|
|
<I>dpy</I>
|
|
|
|
of no more than
|
|
<I>len</I>
|
|
|
|
bytes of a UTF-16LE- or UTF-16BE-encoded
|
|
<I>string</I>
|
|
|
|
when drawn with
|
|
<I>font</I>,
|
|
|
|
storing them in
|
|
<I>extents</I>.
|
|
|
|
The endianness of
|
|
<I>string</I>
|
|
|
|
must be specified in
|
|
<I>endian</I>.
|
|
|
|
The
|
|
<B>FcEndian</B>
|
|
|
|
data type is defined by the Fontconfig library, and the
|
|
<B>XGlyphInfo</B>
|
|
|
|
data type is defined by the X Rendering Extension library.
|
|
<P>
|
|
|
|
<PRE>
|
|
<B>void</B>
|
|
<B>XftGlyphExtents (Display *</B><I>dpy</I><B>,</B>
|
|
<B> XftFont *</B><I>font</I><B>,</B>
|
|
<B> FT_UInt *</B><I>glyphs</I><B>,</B>
|
|
<B> int </B><I>nglyphs</I><B>,</B>
|
|
<B> XGlyphInfo *</B><I>extents</I><B>);</B>
|
|
</PRE>
|
|
|
|
Also used internally by the
|
|
<B>XftTextExtents</B>*
|
|
|
|
functions,
|
|
<B>XftGlyphExtents</B>
|
|
|
|
computes the pixel extents on display
|
|
<I>dpy</I>
|
|
|
|
of no more than
|
|
<I>nglyphs</I>
|
|
|
|
in the array
|
|
<I>glyphs</I>
|
|
|
|
drawn with
|
|
<I>font</I>,
|
|
|
|
storing them in
|
|
<I>extents</I>.
|
|
|
|
The
|
|
<B>FT_UInt</B>
|
|
|
|
data type is defined by the FreeType library, and the
|
|
<B>XGlyphInfo</B>
|
|
|
|
data type is defined by the X Rendering Extension library.
|
|
<A NAME="lbAJ"> </A>
|
|
<H3>Drawing Strings (and Other Things)</H3>
|
|
|
|
<PRE>
|
|
<B>XftDraw *</B>
|
|
<B>XftDrawCreate (Display *</B><I>dpy</I><B>,</B>
|
|
<B> Drawable </B><I>drawable</I><B>,</B>
|
|
<B> Visual *</B><I>visual</I><B>,</B>
|
|
<B> Colormap </B><I>colormap</I><B>);</B>
|
|
</PRE>
|
|
|
|
<B>XftDrawCreate</B>
|
|
|
|
creates a structure that can be used to render text and rectangles using
|
|
the specified
|
|
<I>drawable</I>,
|
|
|
|
<I>visual</I>,
|
|
|
|
and
|
|
<I>colormap</I>
|
|
|
|
on
|
|
<I>display</I>.
|
|
|
|
The
|
|
<B>Drawable</B>,
|
|
|
|
<B>Visual</B>,
|
|
|
|
and
|
|
<B>Colormap</B>
|
|
|
|
data types are defined by the X11 library.
|
|
<P>
|
|
|
|
<PRE>
|
|
<B>XftDraw *</B>
|
|
<B>XftDrawCreateBitmap (Display *</B><I>dpy</I><B>,</B>
|
|
<B> Pixmap </B><I>bitmap</I><B>);</B>
|
|
</PRE>
|
|
|
|
<B>XftDrawCreateBitmap</B>
|
|
|
|
behaves as
|
|
<B>XftDrawCreate</B>,
|
|
|
|
except it uses an X pixmap of color depth 1 instead of an X drawable.
|
|
The
|
|
<B>Pixmap</B>
|
|
|
|
data type is defined by the X11 library.
|
|
<P>
|
|
|
|
<PRE>
|
|
<B>XftDraw *</B>
|
|
<B>XftDrawCreateAlpha (Display *</B><I>dpy</I><B>,</B>
|
|
<B> Pixmap </B><I>pixmap</I><B>,</B>
|
|
<B> int </B><I>depth</I><B>);</B>
|
|
</PRE>
|
|
|
|
<B>XftDrawCreateAlpha</B>
|
|
|
|
behaves as
|
|
<B>XftDrawCreate</B>,
|
|
|
|
except it uses an X pixmap of color depth
|
|
<I>depth</I>
|
|
|
|
instead of an X drawable.
|
|
The
|
|
<B>Pixmap</B>
|
|
|
|
data type is defined by the X11 library.
|
|
<P>
|
|
|
|
<PRE>
|
|
<B>void</B>
|
|
<B>XftDrawChange (XftDraw *</B><I>draw</I><B>,</B>
|
|
<B> Drawable </B><I>drawable</I><B>);</B>
|
|
</PRE>
|
|
|
|
<B>XftDrawChange</B>
|
|
|
|
changes the X drawable association of the existing Xft draw object
|
|
<I>draw</I>
|
|
|
|
from its current value to
|
|
<I>drawable</I>.
|
|
|
|
<P>
|
|
|
|
<PRE>
|
|
<B>Display *</B>
|
|
<B>XftDrawDisplay (XftDraw *</B><I>draw</I><B>);</B>
|
|
</PRE>
|
|
|
|
<B>XftDrawDisplay</B>
|
|
|
|
returns a pointer to the display associated with the Xft draw object
|
|
<I>draw</I>.
|
|
|
|
<P>
|
|
|
|
<PRE>
|
|
<B>Drawable</B>
|
|
<B>XftDrawDrawable (XftDraw *</B><I>draw</I><B>);</B>
|
|
</PRE>
|
|
|
|
<B>XftDrawDrawable</B>
|
|
|
|
returns the X drawable associated with the Xft draw object
|
|
<I>draw</I>.
|
|
|
|
<P>
|
|
|
|
<PRE>
|
|
<B>Colormap</B>
|
|
<B>XftDrawColormap (XftDraw *</B><I>draw</I><B>);</B>
|
|
</PRE>
|
|
|
|
<B>XftDrawColormap</B>
|
|
|
|
returns the colormap associatied with the Xft draw object
|
|
<I>draw</I>.
|
|
|
|
<P>
|
|
|
|
<PRE>
|
|
<B>Visual *</B>
|
|
<B>XftDrawVisual (XftDraw *</B><I>draw</I><B>);</B>
|
|
</PRE>
|
|
|
|
<B>XftDrawVisual</B>
|
|
|
|
returns a pointer to the visual associated with the Xft draw object
|
|
<I>draw</I>.
|
|
|
|
<P>
|
|
|
|
<PRE>
|
|
<B>Picture</B>
|
|
<B>XftDrawPicture (XftDraw *</B><I>draw</I><B>);</B>
|
|
</PRE>
|
|
|
|
<B>XftDrawPicture</B>
|
|
|
|
returns the picture associated with the Xft draw object
|
|
<I>draw</I>.
|
|
|
|
If the the X server does not support the X Rendering Extension, 0 is
|
|
returned.
|
|
<P>
|
|
|
|
<PRE>
|
|
<B>Picture</B>
|
|
<B>XftDrawSrcPicture (XftDraw *</B><I>draw</I><B>,</B>
|
|
<B> XftColor *</B><I>color</I><B>);</B>
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This function is never called if the X server doesn't support the X
|
|
Rendering Extension; instead,
|
|
<B>XftGlyphCore</B>
|
|
|
|
is used.
|
|
<P>
|
|
|
|
<PRE>
|
|
<B>void</B>
|
|
<B>XftDrawDestroy (XftDraw *</B><I>draw</I><B>);</B>
|
|
</PRE>
|
|
|
|
<B>XftDrawDestroy</B>
|
|
|
|
destroys
|
|
<I>draw</I>
|
|
|
|
(created by one of the
|
|
<B>XftCreate</B>
|
|
|
|
functions) and frees the memory that was allocated for it.
|
|
<P>
|
|
|
|
<PRE>
|
|
<B>void</B>
|
|
<B>XftDrawString8 (XftDraw *</B><I>d</I><B>,</B>
|
|
<B> XftColor *</B><I>color</I><B>,</B>
|
|
<B> XftFont *</B><I>font</I><B>,</B>
|
|
<B> int </B><I>x</I><B>,</B>
|
|
<B> int </B><I>y</I><B>,</B>
|
|
<B> unsigned char *</B><I>string</I><B>,</B>
|
|
<B> int </B><I>len</I><B>);</B>
|
|
</PRE>
|
|
|
|
<B>XftDrawString8</B>
|
|
|
|
draws no more than
|
|
<I>len</I>
|
|
|
|
glyphs of
|
|
<I>string</I>
|
|
|
|
to Xft drawable
|
|
<I>d</I>
|
|
|
|
using
|
|
<I>font</I>
|
|
|
|
in
|
|
<I>color</I>
|
|
|
|
at position
|
|
<I>x</I>,<I> y</I>.
|
|
|
|
<P>
|
|
|
|
<PRE>
|
|
<B>void</B>
|
|
<B>XftDrawRect (XftDraw *</B><I>d</I><B>,</B>
|
|
<B> XftColor *</B><I>color</I><B>,</B>
|
|
<B> int </B><I>x</I><B>,</B>
|
|
<B> int </B><I>y</I><B>,</B>
|
|
<B> unsigned int </B><I>width</I><B>,</B>
|
|
<B> unsigned int </B><I>height</I><B>);</B>
|
|
</PRE>
|
|
|
|
<B>XftDrawRect</B>
|
|
|
|
draws a solid rectangle of the specified
|
|
<I>color</I>,
|
|
|
|
<I>width</I>,
|
|
|
|
and
|
|
<I>height</I>
|
|
|
|
at position
|
|
<I>x</I>,<I> y</I>
|
|
|
|
to Xft drawable
|
|
<I>d</I>.
|
|
|
|
<A NAME="lbAK"> </A>
|
|
<H2>COMPATIBILITY</H2>
|
|
|
|
As of version 2,
|
|
<B>Xft</B>
|
|
|
|
has become relatively stable and is expected to retain source and binary
|
|
compatibility in future releases.
|
|
<P>
|
|
|
|
<B>Xft</B>
|
|
|
|
does provide a compatibility interface to its previous major version,
|
|
Xft
|
|
1.<I>x</I>,
|
|
|
|
described below.
|
|
<A NAME="lbAL"> </A>
|
|
<H3>Xft 1.x Compatibility Header File</H3>
|
|
|
|
<B>#include <<A HREF="file:///usr/include/X11/Xft/XftCompat.h">X11/Xft/XftCompat.h</A>></B>
|
|
|
|
|
|
<A NAME="lbAM"> </A>
|
|
<H3>Xft 1.x Compatibility Data Types</H3>
|
|
|
|
<DL COMPACT>
|
|
<DT id="28"><B>XftPattern</B>
|
|
|
|
<DD>
|
|
holds a set of names with associated value lists; each name refers to a
|
|
property of a font.
|
|
<B>XftPattern</B>s
|
|
|
|
are used as inputs to the matching code as well as holding information
|
|
about specific fonts.
|
|
<DT id="29"><B>XftFontSet</B>
|
|
|
|
<DD>
|
|
contains a list of
|
|
<B>XftPattern</B>s.
|
|
|
|
Internally,
|
|
<B>Xft</B>
|
|
|
|
uses this data structure to hold sets of fonts.
|
|
Externally,
|
|
<B>Xft</B>
|
|
|
|
returns the results of listing fonts in this format.
|
|
<DT id="30"><B>XftObjectSet</B>
|
|
|
|
<DD>
|
|
holds a set of names and is used to specify which fields from fonts are
|
|
placed in the the list of returned patterns when listing fonts.
|
|
|
|
</DL>
|
|
<A NAME="lbAN"> </A>
|
|
<H2>AUTHOR</H2>
|
|
|
|
Keith Packard
|
|
<A NAME="lbAO"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<I>Fontconfig Developers Reference</I>
|
|
|
|
<BR>
|
|
|
|
<I>FreeType API Reference</I>
|
|
|
|
<BR>
|
|
|
|
<I>Xlib - C Language Interface</I>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="31"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="32"><A HREF="#lbAC">DESCRIPTION</A><DD>
|
|
<DT id="33"><A HREF="#lbAD">HEADER FILE</A><DD>
|
|
<DT id="34"><A HREF="#lbAE">CONSTANTS</A><DD>
|
|
<DT id="35"><A HREF="#lbAF">DATA TYPES</A><DD>
|
|
<DT id="36"><A HREF="#lbAG">FUNCTIONS</A><DD>
|
|
<DL>
|
|
<DT id="37"><A HREF="#lbAH">Opening and Matching Fonts</A><DD>
|
|
<DT id="38"><A HREF="#lbAI">Determining the Pixel Extents of a Text String</A><DD>
|
|
<DT id="39"><A HREF="#lbAJ">Drawing Strings (and Other Things)</A><DD>
|
|
</DL>
|
|
<DT id="40"><A HREF="#lbAK">COMPATIBILITY</A><DD>
|
|
<DL>
|
|
<DT id="41"><A HREF="#lbAL">Xft 1.x Compatibility Header File</A><DD>
|
|
<DT id="42"><A HREF="#lbAM">Xft 1.x Compatibility Data Types</A><DD>
|
|
</DL>
|
|
<DT id="43"><A HREF="#lbAN">AUTHOR</A><DD>
|
|
<DT id="44"><A HREF="#lbAO">SEE ALSO</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:06:00 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|