summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <Alan.Coopersmith@sun.com>2005-06-24 22:43:20 +0000
committerAlan Coopersmith <Alan.Coopersmith@sun.com>2005-06-24 22:43:20 +0000
commit403c9f9886cea9fd390a242e7c031ba2cc26217f (patch)
tree658f8b187b522ed4ad0514ae30cbe495d45ba503
parent1d14cc37d43bf349ee18e748f62913a0963f6e85 (diff)
downloadxorg-lib-libXft-403c9f9886cea9fd390a242e7c031ba2cc26217f.tar.gz
Sync with Xft from xlibs CVS (2.1.7 plus man page updates from BrandenXORG-6_8_99_13
Robinson) - see lib/Xft/ChangeLog for full details
-rw-r--r--AUTHORS2
-rw-r--r--README54
-rw-r--r--include/X11/Xft/Xft.h5
-rw-r--r--include/X11/Xft/XftCompat.h3
-rw-r--r--man/Xft.3.in868
-rw-r--r--man/xft-config.1.in120
-rw-r--r--src/xftcolor.c3
-rw-r--r--src/xftcore.c5
-rw-r--r--src/xftdbg.c5
-rw-r--r--src/xftdpy.c72
-rw-r--r--src/xftdraw.c9
-rw-r--r--src/xftextent.c18
-rw-r--r--src/xftfont.c6
-rw-r--r--src/xftfreetype.c30
-rw-r--r--src/xftglyphs.c20
-rw-r--r--src/xftinit.c6
-rw-r--r--src/xftint.h24
-rw-r--r--src/xftlist.c4
-rw-r--r--src/xftname.c4
-rw-r--r--src/xftrender.c4
-rw-r--r--src/xftstr.c6
-rw-r--r--src/xftswap.c4
-rw-r--r--src/xftxlfd.c6
23 files changed, 1091 insertions, 187 deletions
diff --git a/AUTHORS b/AUTHORS
index c49ee49..2fe754d 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,4 +1,4 @@
-Keith Packard, of SuSE, HP, and XFree86
+Keith Packard, of SuSE and HP
Automake work by Noah Levitt
Frank Giessler - OS/2
diff --git a/README b/README
index 4dcab4d..4a18a4c 100644
--- a/README
+++ b/README
@@ -1,12 +1,36 @@
- Xft
- X FreeType library
- Version 2.1.3
- 2003-3-10
+ Xft
+ X FreeType library
+ Version 2.1.7
+ 2005-3-29
Xft version 2.1 is the first stand alone release of Xft, a library that
connects X applications with the FreeType font rasterization library. Xft
uses fontconfig to locate fonts so it has no configuration files.
+Version 2.1.7
+
+Change FC_CHARCELL and FC_MONO interpretation. FC_MONO no longer clips
+glyphs to charcell, you must specify FC_CHARCELL for that.
+
+Add support for FT_GlyphSlot_Embolden where it exists (which it usually
+doesn't).
+
+Avoid crashing when using FT_Face objects.
+
+Version 2.1.6
+
+Deal with broken FreeType 2.1.7 BDF/PCF loaders by trying both y_ppem/x_ppem
+and width/height values.
+
+Version 2.1.5
+
+Left some #warnings from testing in the 2.1.4 release. Spin again.
+
+Version 2.1.4
+
+Work with older versions of Fontconfig by using various pattern elements
+only when defined.
+
Version 2.1.3
Change Freetype includes to new syntax.
@@ -15,5 +39,27 @@ Search for nearest bitmap for bitmap-only fonts.
Support fontconfig 2.2 release which doesn't include FC_HINT_STYLE.
+To release a version of this library:
+
+ 1. Update the version numbers
+ configure.ac
+ Xft.h
+ 2. Fix the README
+ Change version number
+ Set the date
+ 3. Commit those changes
+ 4. rebuild the configuration files with autogen.sh
+ sh autogen.sh --sysconfdir=/etc --prefix=/usr --mandir=/usr/share/man
+ 5. make distcheck
+ 6. tag the tree
+ cvs tag Xft-2_1_xx
+ 7. Copy Xft-2.1.xx.tar.gz and Xft-2.1.xx.tar.bz2 to
+ freedesktop.org:/srv/xlibs.freedesktop.org/www/release
+ 8. Compute md5sums for release files:
+ md5sum Xft-2.1.xx.tar.gz Xft-2.1.xx.tar.bz2
+ 9. Post a note to xorg@freedesktop.org. Include the md5sums.
+ gpg sign the message.
+
+
Keith Packard
keithp@keithp.com
diff --git a/include/X11/Xft/Xft.h b/include/X11/Xft/Xft.h
index 68b5d06..382d024 100644
--- a/include/X11/Xft/Xft.h
+++ b/include/X11/Xft/Xft.h
@@ -1,6 +1,7 @@
/*
+ * $Id$
*
- * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
+ * Copyright © 2000 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -32,7 +33,7 @@
#define XFT_MAJOR 2
#define XFT_MINOR 1
-#define XFT_REVISION 6
+#define XFT_REVISION 7
#define XFT_VERSION ((XFT_MAJOR * 10000) + (XFT_MINOR * 100) + (XFT_REVISION))
#define XftVersion XFT_VERSION
diff --git a/include/X11/Xft/XftCompat.h b/include/X11/Xft/XftCompat.h
index 34a6d08..944fb67 100644
--- a/include/X11/Xft/XftCompat.h
+++ b/include/X11/Xft/XftCompat.h
@@ -1,6 +1,7 @@
/*
+ * $Id$
*
- * Copyright © 2001 Keith Packard, member of The XFree86 Project, Inc.
+ * Copyright © 2001 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
diff --git a/man/Xft.3.in b/man/Xft.3.in
index 4c9f95c..fdd3d71 100644
--- a/man/Xft.3.in
+++ b/man/Xft.3.in
@@ -21,121 +21,827 @@
.\" TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
-.de TQ
-.br
-.ns
-.TP \\$1
-..
-.TH XFT 3 "Version @VERSION@" "Xft"
-
+.TH Xft 3 "Version @VERSION@" "Xft"
.SH NAME
Xft \- X FreeType interface library
-
.SH DESCRIPTION
.B Xft
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.
-
-.SH DATATYPES
-
-.B XftPattern
-holds a set of names with associated value lists; each name refers to a
-property of a font. XftPatterns are used as inputs to the matching code as
-well as holding information about specific fonts.
-
+Rendering Extension.
+This manual page barely scratches the surface of this library.
+.SH "HEADER FILE"
+.B #include <X11/Xft/Xft.h>
+.SH CONSTANTS
+.TP
+.B XFT_MAJOR
+is the major version number of
+.BR Xft .
+.TP
+.B XFT_MINOR
+is the minor version number of
+.BR Xft .
+.TP
+.B XFT_REVISION
+is the revision number of
+.BR Xft .
+.TP
+.B XFT_VERSION
+is
+.B XFT_MAJOR
+times 10000 (ten thousand), plus
+.B XFT_MINOR
+times 100, plus
+.BR XFT_REVISION .
+.TP
+.B XftVersion
+is an alias for
+.BR XFT_VERSION .
+.PP
+The following example illustrates how
+.BR Xft 's
+version constants might be used:
+.nf
+ #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.\(rsn", XFT_MAJOR,
+ XFT_MINOR,
+ XFT_REVISION);
+ #endif
+.fi
+.\" I don't understand what these are for. -- BR, 2005-04-02
+.\" XFT_CORE used in xftname.c
+.\" XFT_RENDER used in xftdpy.c, xftfreetype.c, xftname.c
+.\" XFT_XLFD used in xftname.c, xftxlfd.c
+.\" XFT_MAX_GLYPH_MEMORY used in xftdpy.c, xftfreetype.c
+.\" XFT_MAX_UNREF_FONTS used in xftdpy.c
+.\" XFT_NMISSING used in xftcore.c, xftextent.c, xftglyphs.c,
+.\" xftrender.c
+.SH "DATA TYPES"
+.TP
.B XftFont
-contains general font metrics and a pointer to either the core XFontStruct
-data or a structure holding FreeType and X Render Extension data.
-
-.B XftFontStruct
-contains information about FreeType fonts used with the X Render Extension.
-
-.B XftFontSet
-contains a list of XftPatterns. Internally Xft uses this data structure to
-hold sets of fonts. Externally, Xft returns the results of listing fonts in
-this format.
-
-.B XftObjectSet
-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.
-
+.nf
+typedef struct _XftFont {
+ int ascent;
+ int descent;
+ int height;
+ int max_advance_width;
+ FcCharSet *charset;
+ FcPattern *pattern;
+} XftFont;
+.fi
+An
+.B XftFont
+is the primary data structure of interest to programmers using
+.BR Xft ;
+it contains general font metrics and pointers to the Fontconfig
+character set and pattern associated with the font.
+The
+.B FcCharSet
+and
+.B FcPattern
+data types are defined by the Fontconfig library.
+.TP
+.B ""
+.BR XftFont s
+are populated with any of
+.BR XftFontOpen (),
+.BR XftFontOpenName (),
+.BR XftFontOpenXlfd (),
+.BR XftFontOpenInfo (),
+or
+.BR XftFontOpenPattern ().
+.BR XftFontCopy ()
+is used to duplicate
+.BR XftFont s,
+and
+.BR XftFontClose ()
+is used to mark an
+.B XftFont
+as unused.
+.BR XftFont s
+are internally allocated, reference-counted, and freed by
+.BR Xft ;
+the programmer does not ordinarily need to allocate or free storage
+for them.
+.TP
+.B ""
+.BR XftDrawGlyphs (),
+the
+.BR XftDrawString *()
+family,
+.BR XftDrawCharSpec (),
+and
+.BR XftDrawGlyphSpec ()
+use
+.BR XftFont s
+to render text to an
+.B XftDraw
+object, which may correspond to either a core X drawable or an X
+Rendering Extension drawable.
+.TP
+.B ""
+.BR XftGlyphExtents ()
+and the
+.BR XftTextExtents *()
+family are used to determine the extents (maximum dimensions) of an
+.BR XftFont .
+.TP
+.B ""
+An
+.BR XftFont 's
+glyph or character coverage can be determined with
+.BR XftFontCheckGlyph ()
+or
+.BR XftCharExists ().
+.BR XftCharIndex ()
+returns the
+.BR XftFont -specific
+character index corresponding to a given Unicode codepoint.
+.TP
+.B ""
+.BR XftGlyphRender (),
+.BR XftGlyphSpecRender (),
+.BR XftCharSpecRender (),
+and the
+.BR XftTextRender *()
+family use
+.BR XftFont s
+to draw into X Rendering Extension
+.B Picture
+structures.
+.B Note:
+.BR XftDrawGlyphs (),
+the
+.BR XftDrawString *()
+family,
+.BR XftDrawCharSpec (),
+and
+.BR XftDrawGlyphSpec ()
+provide a means of rendering fonts that is independent of the
+availability of the X Rendering Extension on the X server.
+.\" I'm not sure what these are for; they're used internally, but why
+.\" would any external users want them? -- BR, 2005-04-02
+.\" .BR XftLockFace()
+.\" .BR XftUnlockFace()
+.TP
+.B XftFontInfo
+is an opaque object that stores information about a font.
+.B XftFontInfo
+structures are created with
+.BR XftFontInfoCreate (),
+freed with
+.BR XftFontInfoDestroy (),
+and compared with
+.BR XftFontInfoEqual ().
+.B XftFontInfo
+objects are internally allocated and freed by
+.BR Xft ;
+the programmer does not ordinarily need to allocate or free storage
+for them.
+.TP
+.B ""
+Each
+.B XftFontInfo
+structure in use is associated with a unique identifier, which can be
+retrieved with
+.BR XftFontInfoHash ().
+An
+.B XftFont
+can be opened based on
+.B XftFontInfo
+data with
+.BR XftFontOpenInfo ().
+.TP
+.B XftColor
+.nf
+typedef struct _XftColor {
+ unsigned long pixel;
+ XRenderColor color;
+} XftColor;
+.fi
+An
+.B XftColor
+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
+data type is defined by the X Render Extension library.
+.TP
+.B ""
+.BR XftColorAllocName ()
+and
+.BR XftColorAllocValue ()
+request a color allocation from the X server (if necessary) and
+initialize the members of
+.BR XftColor .
+.BR XftColorFree ()
+instructs the X server to free the color currently allocated for an
+.BR XftColor .
+.TP
+.B ""
+One an
+.B XftColor
+has been initialized,
+.BR XftDrawSrcPicture (),
+.BR XftDrawGlyphs (),
+the
+.BR XftDrawString *()
+family,
+.BR XftDrawCharSpec (),
+.BR XftDrawCharFontSpec (),
+.BR XftDrawGlyphSpec (),
+.BR XftDrawGlyphFontSpec (),
+and
+.BR XftDrawRect ()
+may be used to draw various objects using it.
+.TP
.B XftDraw
is an opaque object which holds information used to render to an X drawable
-using either core protocol or the X Rendering extension.
-
+using either the core protocol or the X Rendering extension.
+.TP
+.B ""
+.B XftDraw
+objects are created with any of
+.BR XftDrawCreate ()
+(which associates an
+.B XftDraw
+with an existing X drawable),
+.BR XftDrawCreateBitmap (),
+or
+.BR XftDrawCreateAlpha (),
+and destroyed with
+.BR XftDrawDestroy ().
+The X drawable associated with an
+.B XftDraw
+can be changed with
+.BR XftDrawChange ().
+.BR XftDraw s
+are internally allocated and freed by
+.BR Xft ;
+the programmer does not ordinarily need to allocate or free storage
+for them.
+.TP
+.B ""
+The X
+.BR Display ,
+.BR Drawable ,
+.BR Colormap ,
+and
+.BR Visual
+of an
+.B XftDraw
+can be queried with
+.BR XftDrawDisplay (),
+.BR XftDrawDrawable (),
+.BR XftDrawColormap (),
+and
+.BR XftDrawVisual (),
+respectively.
+The X Rendering Extension
+.B Picture
+associated with an
+.B XftDraw
+is returned by
+.BR XftDrawPicture ().
+.\" XftDrawSrcPicture
+.\" XftDrawGlyphs
+.\" XftDrawString*
+.\" XftDrawCharSpec
+.\" XftDrawCharFontSpec
+.\" XftDrawGlyphSpec
+.\" XftDrawGlyphFontSpec
+.\" XftDrawRect
+.\" XftDrawSetClip
+.\" XftDrawSetClipRectangles
+.\" XftDrawSetSubwindowMode
+.TP
+.B XftCharSpec
+.nf
+typedef struct _XftCharSpec {
+ FcChar32 ucs4;
+ short x;
+ short y;
+} XftCharSpec;
+.fi
+.TP
+.B ""
+The
+.B FcChar32
+data type is defined by the Fontconfig library.
+.\" XftDrawCharSpec
+.\" XftCharSpecRender
+.TP
+.B XftCharFontSpec
+.nf
+typedef struct _XftCharFontSpec {
+ XftFont *font;
+ FcChar32 ucs4;
+ short x;
+ short y;
+} XftCharFontSpec;
+.fi
+.TP
+.B ""
+The
+.B FcChar32
+data type is defined by the Fontconfig library.
+.\" XftDrawCharFontSpec
+.\" XftCharFontSpecRender
+.TP
+.B XftGlyphSpec
+.nf
+typedef struct _XftGlyphSpec {
+ FT_UInt glyph;
+ short x;
+ short y;
+} XftGlyphSpec;
+.fi
+.TP
+.B ""
+The
+.B FT_UInt
+data type is defined by the FreeType library.
+.\" XftDrawGlyphSpec
+.\" XftGlyphSpecRender
+.TP
+.B XftGlyphFontSpec
+.nf
+typedef struct _XftGlyphFontSpec {
+ XftFont *font;
+ FT_UInt glyph;
+ short x;
+ short y;
+} XftGlyphFontSpec;
+.fi
+.TP
+.B ""
+The
+.B FT_UInt
+data type is defined by the FreeType library.
+.\" XftDrawGlyphFontSpec
+.\" XftGlyphFontSpecRender
.SH FUNCTIONS
+.SS "Opening and Matching Fonts"
.nf
-XftFont *
-XftFontOpen (Display *dpy, int screen, ...);
+\fBXftFont *\fR
+\fBXftFontOpen (Display *\fIdpy\fB,\fR
+\fB int \fIscreen\fB,\fR
+\fB ...);\fR\fR
.fi
.B XftFontOpen
-takes a list of pattern elements of the form (field, type, value) terminated
-with a NULL, matches that pattern against the available fonts and opens the
-matching font.
+takes a list of pattern element triples of the form
+.IR field , " type" , " value"
+(terminated with a NULL), matches that pattern against the available fonts,
+and opens the matching font, sizing it correctly for screen number
+.I screen
+on display
+.IR dpy .
+The
+.B Display
+data type is defined by the X11 library.
+Returns NULL if no match is found.
.PP
Example:
-.br
- font = XftFontOpen (dpy, scr,
- XFT_FAMILY, XftTypeString, "charter",
- XFT_SIZE, XftTypeDouble, 12.0,
- NULL);
+.nf
+ font = XftFontOpen (dpy, screen,
+ XFT_FAMILY, XftTypeString, "charter",
+ XFT_SIZE, XftTypeDouble, 12.0,
+ NULL);
+.fi
+This opens the \(lqcharter\(rq font at 12 points.
+The point size is automatically converted to the correct pixel size based
+on the resolution of the monitor.
.PP
-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.
+.nf
+\fBXftFont *\fR
+\fBXftFontOpenName (Display *\fIdpy\fB,\fR
+\fB int \fIscreen\fB,\fR
+\fB unsigned char *\fIname\fB);\fR
+.fi
+.B XftFontOpenName
+behaves as
+.B XftFontOpen
+does, except that it takes a Fontconfig pattern string (which is passed to
+the Fontconfig library's
+.BR FcNameParse ()
+function).
.PP
.nf
-void
-XftTextExtents8 (Display *dpy,
- XftFont *font,
- unsigned char *string,
- int len,
- XGlyphInfo *extents);
+\fBXftFont *\fR
+\fBXftFontOpenXlfd (Display *\fIdpy\fB,\fR
+\fB int \fIscreen\fB,\fR
+\fB unsigned char *\fIxlfd\fB)\fR
+.fi
+.B XftFontOpenXlfd
+behaves as
+.B XftFontOpen
+does, except that it takes a string containing an X Logical Font
+Description (XLFD).
+.PP
+.nf
+\fBFcPattern *\fR
+\fBXftFontMatch (Display *\fIdpy\fB,\fR
+\fB int \fIscreen\fB,\fR
+\fB FcPattern *\fIpattern\fB,\fR
+\fB FcResult *\fIresult\fB);\fR
+.fi
+Also used internally by the
+.BR XftFontOpen *
+functions,
+.B XftFontMatch
+can also be used directly to determine the Fontconfig font pattern
+resulting from an Xft font open request.
+The
+.B FcPattern
+and
+.B FcResult
+data types are defined by the Fontconfig library.
+.SS "Determining the Pixel Extents of a Text String"
+.nf
+\fBvoid\fR
+\fBXftTextExtents8 (Display *\fIdpy\fB,\fR
+\fB XftFont *\fIfont\fB,\fR
+\fB FcChar8 *\fIstring\fB,\fR
+\fB int \fIlen\fB,\fR
+\fB XGlyphInfo *\fIextents\fB);\fR
.fi
.B XftTextExtents8
-computes the pixel extents of "string" when drawn with "font".
+computes the pixel extents on display
+.I dpy
+of no more than
+.I len
+glyphs of a
+.I string
+consisting of eight-bit characters when drawn with
+.IR font ,
+storing them in
+.IR extents .
+The
+.B FcChar8
+data type is defined by the Fontconfig library, and the
+.B XGlyphInfo
+data type is defined by the X Rendering Extension library.
+.PP
+.nf
+\fBvoid\fR
+\fBXftTextExtents16 (Display *\fIdpy\fB,\fR
+\fB XftFont *\fIfont\fB,\fR
+\fB FcChar16 *\fIstring\fB,\fR
+\fB int \fIlen\fB,\fR
+\fB XGlyphInfo *\fIextents\fB);\fR
+.fi
+.B XftTextExtents16
+computes the pixel extents on display
+.I dpy
+of no more than
+.I len
+glyphs of a
+.I string
+consisting of sixteen-bit characters when drawn with
+.IR font ,
+storing them in
+.IR extents .
+The
+.B FcChar16
+data type is defined by the Fontconfig library, and the
+.B XGlyphInfo
+data type is defined by the X Rendering Extension library.
+.PP
+.nf
+\fBvoid\fR
+\fBXftTextExtents32 (Display *\fIdpy\fB,\fR
+\fB XftFont *\fIfont\fB,\fR
+\fB FcChar32 *\fIstring\fB,\fR
+\fB int \fIlen\fB,\fR
+\fB XGlyphInfo *\fIextents\fB);\fR
+.fi
+.B XftTextExtents32
+computes the pixel extents on display
+.I dpy
+of no more than
+.I len
+glyphs of a
+.I string
+consisting of thirty-two-bit characters when drawn with
+.IR font ,
+storing them in
+.IR extents .
+The
+.B FcChar32
+data type is defined by the Fontconfig library, and the
+.B XGlyphInfo
+data type is defined by the X Rendering Extension library.
.PP
.nf
-XftDraw *
-XftDrawCreate (Display *dpy,
- Drawable drawable,
- Visual *visual,
- Colormap colormap);
+\fBvoid\fR
+\fBXftTextExtentsUtf8 (Display *\fIdpy\fB,\fR
+\fB XftFont *\fIfont\fB,\fR
+\fB FcChar8 *\fIstring\fB,\fR
+\fB int \fIlen\fB,\fR
+\fB XGlyphInfo *\fIextents\fB);\fR
+.fi
+.B XftTextExtentsUtf8
+computes the pixel extents on display
+.I dpy
+of no more than
+.I len
+bytes of a UTF-8 encoded
+.I string
+when drawn with
+.IR font ,
+storing them in
+.IR extents .
+The
+.B XGlyphInfo
+data type is defined by the X Rendering Extension library.
+.PP
+.nf
+\fBvoid\fR
+\fBXftTextExtentsUtf16 (Display *\fIdpy\fB,\fR
+\fB XftFont *\fIfont\fB,\fR
+\fB FcChar8 *\fIstring\fB,\fR
+\fB FcEndian \fIendian\fB,\fR
+\fB int \fIlen\fB,\fR
+\fB XGlyphInfo *\fIextents\fB);\fR
+.fi
+.B XftTextExtentsUtf16
+computes the pixel extents on display
+.I dpy
+of no more than
+.I len
+bytes of a UTF-16LE- or UTF-16BE-encoded
+.I string
+when drawn with
+.IR font ,
+storing them in
+.IR extents .
+The endianness of
+.I string
+must be specified in
+.IR endian .
+The
+.B FcEndian
+data type is defined by the Fontconfig library, and the
+.B XGlyphInfo
+data type is defined by the X Rendering Extension library.
+.PP
+.nf
+\fBvoid\fR
+\fBXftGlyphExtents (Display *\fIdpy\fB,\fR
+\fB XftFont *\fIfont\fB,\fR
+\fB FT_UInt *\fIglyphs\fB,\fR
+\fB int \fInglyphs\fB,\fR
+\fB XGlyphInfo *\fIextents\fB);\fR
+.fi
+Also used internally by the
+.BR XftTextExtents *
+functions,
+.B XftGlyphExtents
+computes the pixel extents on display
+.I dpy
+of no more than
+.I nglyphs
+in the array
+.I glyphs
+drawn with
+.IR font ,
+storing them in
+.IR extents .
+The
+.B FT_UInt
+data type is defined by the FreeType library, and the
+.B XGlyphInfo
+data type is defined by the X Rendering Extension library.
+.SS "Drawing Strings (and Other Things)"
+.nf
+\fBXftDraw *\fR
+\fBXftDrawCreate (Display *\fIdpy\fB,\fR
+\fB Drawable \fIdrawable\fB,\fR
+\fB Visual *\fIvisual\fB,\fR
+\fB Colormap \fIcolormap\fB);\fR
.fi
.B XftDrawCreate
-creates a structure that can be used to render text and rectangles
-to the screen.
+creates a structure that can be used to render text and rectangles using
+the specified
+.IR drawable ,
+.IR visual ,
+and
+.I colormap
+on
+.IR display .
+The
+.BR Drawable ,
+.BR Visual ,
+and
+.B Colormap
+data types are defined by the X11 library.
+.PP
+.nf
+\fBXftDraw *\fR
+\fBXftDrawCreateBitmap (Display *\fIdpy\fB,\fR
+\fB Pixmap \fIbitmap\fB);\fR
+.fi
+.B XftDrawCreateBitmap
+behaves as
+.BR XftDrawCreate ,
+except it uses an X pixmap of color depth 1 instead of an X drawable.
+The
+.B Pixmap
+data type is defined by the X11 library.
+.PP
+.nf
+\fBXftDraw *\fR
+\fBXftDrawCreateAlpha (Display *\fIdpy\fB,\fR
+\fB Pixmap \fIpixmap\fB,\fR
+\fB int \fIdepth\fB);\fR
+.fi
+.B XftDrawCreateAlpha
+behaves as
+.BR XftDrawCreate ,
+except it uses an X pixmap of color depth
+.I depth
+instead of an X drawable.
+The
+.B Pixmap
+data type is defined by the X11 library.
+.PP
+.nf
+\fBvoid\fR
+\fBXftDrawChange (XftDraw *\fIdraw\fB,\fR
+\fB Drawable \fIdrawable\fB);\fR
+.fi
+.B XftDrawChange
+changes the X drawable association of the existing Xft draw object
+.I draw
+from its current value to
+.IR drawable .
+.PP
+.nf
+\fBDisplay *\fR
+\fBXftDrawDisplay (XftDraw *\fIdraw\fB);\fR
+.fi
+.B XftDrawDisplay
+returns a pointer to the display associated with the Xft draw object
+.IR draw .
+.PP
+.nf
+\fBDrawable\fR
+\fBXftDrawDrawable (XftDraw *\fIdraw\fB);\fR
+.fi
+.B XftDrawDrawable
+returns the X drawable associated with the Xft draw object
+.IR draw .
+.PP
+.nf
+\fBColormap\fR
+\fBXftDrawColormap (XftDraw *\fIdraw\fB);\fR
+.fi
+.B XftDrawColormap
+returns the colormap associatied with the Xft draw object
+.IR draw .
.PP
.nf
-void
-XftDrawString8 (XftDraw *d,
- XRenderColor *color,
- XftFont *font,
- int x,
- int y,
- unsigned char *string,
- int len);
+\fBVisual *\fR
+\fBXftDrawVisual (XftDraw *\fIdraw\fB);\fR
+.fi
+.B XftDrawVisual
+returns a pointer to the visual associated with the Xft draw object
+.IR draw .
+.PP
+.nf
+\fBPicture\fR
+\fBXftDrawPicture (XftDraw *\fIdraw\fB);\fR
+.fi
+.B XftDrawPicture
+returns the picture associated with the Xft draw object
+.IR draw .
+If the the X server does not support the X Rendering Extension, 0 is
+returned.
+.PP
+.nf
+\fBPicture\fR
+\fBXftDrawSrcPicture (XftDraw *\fIdraw\fB,\fR
+\fB XftColor *\fIcolor\fB);\fR
+.fi
+.\" Unfortunately, I'm not quite sure what this does. I think it is the gizmo
+.\" that is used to create an Xrender Picture object so that glyphs can be
+.\" drawn in the XftDraw object
+.\" .I draw
+.\" using the specified
+.\" .IR color .
+.\" -- BR, 2005-04-02
+This function is never called if the X server doesn't support the X
+Rendering Extension; instead,
+.B XftGlyphCore
+is used.
+.PP
+.nf
+\fBvoid\fR
+\fBXftDrawDestroy (XftDraw *\fIdraw\fB);\fR
+.fi
+.B XftDrawDestroy
+destroys
+.I draw
+(created by one of the
+.B XftCreate
+functions) and frees the memory that was allocated for it.
+.PP
+.nf
+\fBvoid\fR
+\fBXftDrawString8 (XftDraw *\fId\fB,\fR
+\fB XRenderColor *\fIcolor\fB,\fR
+\fB XftFont *\fIfont\fB,\fR
+\fB int \fIx\fB,\fR
+\fB int \fIy\fB,\fR
+\fB unsigned char *\fIstring\fB,\fR
+\fB int \fIlen\fB);\fR
.fi
.B XftDrawString8
-draws "string" using "font" in "color" at "x, y".
+draws no more than
+.I len
+glyphs of
+.I string
+to Xft drawable
+.I d
+using
+.I font
+in
+.I color
+at position
+.IR x , " y" .
+The
+.B XRenderColor
+data type is defined by the X Rendering Extension library.
.PP
.nf
-void
-XftDrawRect (XftDraw *d,
- XRenderColor *color,
- int x,
- int y,
- unsigned int width,
- unsigned int height);
+\fBvoid\fR
+\fBXftDrawRect (XftDraw *\fId\fB,\fR
+\fB XRenderColor *\fIcolor\fB,\fR
+\fB int \fIx\fB,\fR
+\fB int \fIy\fB,\fR
+\fB unsigned int \fIwidth\fB,\fR
+\fB unsigned int \fIheight\fB);\fR
.fi
.B XftDrawRect
-fills a solid rectangle in the specified color.
-
+draws a solid rectangle of the specified
+.IR color ,
+.IR width ,
+and
+.I height
+at position
+.IR x , " y"
+to Xft drawable
+.IR d .
.SH COMPATIBILITY
-As of version 2,
+As of version 2,
.B Xft
has become relatively stable and is expected to retain source and binary
compatibility in future releases.
-
+.PP
+.B Xft
+does provide a compatibility interface to its previous major version,
+Xft
+.RI 1. x ,
+described below.
+.SS "Xft 1.x Compatibility Header File"
+.B #include <X11/Xft/XftCompat.h>
+.\" .SS "Xft 1.x Compatibility Constants"
+.SS "Xft 1.x Compatibility Data Types"
+.TP
+.B XftPattern
+holds a set of names with associated value lists; each name refers to a
+property of a font.
+.BR XftPattern s
+are used as inputs to the matching code as well as holding information
+about specific fonts.
+.TP
+.B XftFontSet
+contains a list of
+.BR XftPattern s.
+Internally,
+.B Xft
+uses this data structure to hold sets of fonts.
+Externally,
+.B Xft
+returns the results of listing fonts in this format.
+.TP
+.B XftObjectSet
+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.
+.\" .SS "Xft 1.x Compatibility Functions"
.SH AUTHOR
Keith Packard
+.SH "SEE ALSO"
+.I Fontconfig Developers Reference
+.br
+.I FreeType API Reference
+.br
+.I Xlib \- C Language Interface
+.\" Set Vim modeline; textwidth is 70 to account for the extra margin
+.\" padding that man (on Debian GNU/Linux) does for output to
+.\" terminals (7 spaces on the left, 2 on the right), so that we don't
+.\" go past 80 columns total, particularly in .nf/.fi regions.
+.\" vim:set ai et sts=4 sw=4 tw=70:
diff --git a/man/xft-config.1.in b/man/xft-config.1.in
new file mode 100644
index 0000000..904c243
--- /dev/null
+++ b/man/xft-config.1.in
@@ -0,0 +1,120 @@
+.\" Copyright 2005 Branden Robinson
+.\"
+.\" Permission is hereby granted, free of charge, to any person obtaining a copy
+.\" of this document (the "Document"), to deal in the Document without
+.\" restriction, including without limitation the rights to use, copy, modify,
+.\" merge, publish, distribute, sublicense, and/or sell copies of the Document,
+.\" and to permit persons to whom the Document 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 Document.
+.\"
+.\" THE DOCUMENT 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 AUTHOR(S) OR COPYRIGHT HOLDER(S) 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 DOCUMENT OR THE USE OR OTHER
+.\" DEALINGS IN THE DOCUMENT.
+.TH xft-config 1 "Version @VERSION@" "Xft"
+.SH NAME
+xft\-config \- report Xft version, compiler, linker, and/or installation \
+directory information
+.SH SYNOPSIS
+.B xft\-config
+{
+.BR \-\-exec\-prefix [ =\fIlocal_prefix\fR ]
+|
+.BR \-\-prefix [ =\fIlocal_prefix\fR ]
+|
+.B \-\-cflags
+|
+.B \-\-libs
+} ...
+.PP
+.B xft\-config \-\-version
+.SH DESCRIPTION
+.B xft\-config
+reports information of interest to users and developers about the installed
+version of the X FreeType library,
+.BR Xft (3).
+Depending on how it is invoked,
+.B xft\-config
+reports the installed version of Xft, the compiler and linker flags
+that are required to successfully compile and link C (or C-compatible) code
+that uses the library, and/or the directories used by the GNU Autotools to
+install its files.
+Note that if the system's installed version of Xft came from an OS vendor
+or other third party, the actual location of its files may differ from
+those reported by
+.BR xft\-config .
+The system adminstrator can also relocate Xft's files.
+.PP
+If invoked without any arguments,
+.B xft\-config
+will print a usage message on standard error and exit.
+.SH OPTIONS
+.TP
+.B \-\-cflags
+Report the compiler flags that are required to compile code that uses Xft
+symbols.
+.TP
+.BR \-\-exec\-prefix [ =\fIlocal_prefix\fR ]
+If specified without the parameter
+.IR local_prefix ,
+report the file specification prefix that Xft uses for installation of
+executable files.
+If
+.I local_prefix
+is specified, it is used instead of the file specification prefix used for
+installation of executable files by Xft and the value of the option
+argument specified with
+.BR \-\-prefix ,
+if any, when compile and linker flags are reported (with
+.B \-\-cflags
+and
+.BR \-\-libs ,
+respectively).
+.TP
+.B \-\-libs
+Report the linker flags that are required to link code that uses Xft
+symbols.
+.TP
+.BR \-\-prefix [ =\fIlocal_prefix\fR ]
+If specified without the parameter
+.IR local_prefix ,
+report the file specification prefix that Xft uses for installation of
+files.
+If
+.I local_prefix
+is specified, it is used instead of the file specification prefix used for
+installation of files by Xft when compile and linker flags are reported
+(with
+.B \-\-cflags
+and
+.BR \-\-libs ,
+respectively); also see
+.BR \-\-exec\-prefix .
+.TP
+.B \-\-version
+Report the version of the Xft library installed on the system and exit.
+.SH OPERANDS
+.B xft\-config
+does not recognize any non-option arguments.
+At least one option must be specified.
+.SH "EXIT STATUS"
+.TP
+0
+Information was successfully reported.
+.TP
+1
+.B xft\-config
+was invoked with invalid arguments, or no arguments at all.
+.SH AUTHOR
+.B xft\-config
+was written by Keith Packard.
+This manual page was written by Branden Robinson.
+.SH "SEE ALSO"
+.BR Xft (3)
+.\" vim:set et tw=80
diff --git a/src/xftcolor.c b/src/xftcolor.c
index 7377c78..511f52e 100644
--- a/src/xftcolor.c
+++ b/src/xftcolor.c
@@ -1,6 +1,7 @@
/*
+ * $Id$
*
- * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
+ * Copyright © 2000 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
diff --git a/src/xftcore.c b/src/xftcore.c
index f43e467..11cdd5e 100644
--- a/src/xftcore.c
+++ b/src/xftcore.c
@@ -1,6 +1,7 @@
/*
+ * $Id$
*
- * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
+ * Copyright © 2000 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -21,9 +22,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-#include <stdlib.h>
#include "xftint.h"
-#include <X11/Xmd.h>
void
XftRectCore (XftDraw *draw,
diff --git a/src/xftdbg.c b/src/xftdbg.c
index c30c6d3..5ed497a 100644
--- a/src/xftdbg.c
+++ b/src/xftdbg.c
@@ -1,6 +1,7 @@
/*
+ * $Id$
*
- * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
+ * Copyright © 2000 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -21,8 +22,6 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-#include <stdlib.h>
-#include <stdio.h>
#include "xftint.h"
int
diff --git a/src/xftdpy.c b/src/xftdpy.c
index 1b38424..0970843 100644
--- a/src/xftdpy.c
+++ b/src/xftdpy.c
@@ -1,6 +1,7 @@
/*
+ * $Id$
*
- * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
+ * Copyright © 2000 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -21,10 +22,6 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <X11/Xlibint.h>
#include "xftint.h"
XftDisplayInfo *_XftDisplayInfo;
@@ -100,6 +97,7 @@ _XftDisplayInfoGet (Display *dpy, FcBool createIfNecessary)
info->display = dpy;
info->defaults = 0;
+ info->solidFormat = 0;
info->hasRender = (XRenderQueryExtension (dpy, &event_base, &error_base) &&
(XRenderFindVisualFormat (dpy, DefaultVisual (dpy, DefaultScreen (dpy))) != 0));
info->use_free_glyphs = FcTrue;
@@ -109,22 +107,23 @@ _XftDisplayInfoGet (Display *dpy, FcBool createIfNecessary)
XRenderQueryVersion (dpy, &major, &minor);
if (major < 0 || (major == 0 && minor <= 2))
info->use_free_glyphs = FcFalse;
+
+ pf.type = PictTypeDirect;
+ pf.depth = 32;
+ pf.direct.redMask = 0xff;
+ pf.direct.greenMask = 0xff;
+ pf.direct.blueMask = 0xff;
+ pf.direct.alphaMask = 0xff;
+ info->solidFormat = XRenderFindFormat (dpy,
+ (PictFormatType|
+ PictFormatDepth|
+ PictFormatRedMask|
+ PictFormatGreenMask|
+ PictFormatBlueMask|
+ PictFormatAlphaMask),
+ &pf,
+ 0);
}
- pf.type = PictTypeDirect;
- pf.depth = 32;
- pf.direct.redMask = 0xff;
- pf.direct.greenMask = 0xff;
- pf.direct.blueMask = 0xff;
- pf.direct.alphaMask = 0xff;
- info->solidFormat = XRenderFindFormat (dpy,
- (PictFormatType|
- PictFormatDepth|
- PictFormatRedMask|
- PictFormatGreenMask|
- PictFormatBlueMask|
- PictFormatAlphaMask),
- &pf,
- 0);
if (XftDebug () & XFT_DBG_RENDER)
{
Visual *visual = DefaultVisual (dpy, DefaultScreen (dpy));
@@ -374,6 +373,10 @@ _XftDefaultInit (Display *dpy)
goto bail1;
if (!_XftDefaultInitBool (dpy, pat, FC_ANTIALIAS))
goto bail1;
+#ifdef FC_EMBOLDEN
+ if (!_XftDefaultInitBool (dpy, pat, FC_EMBOLDEN))
+ goto bail1;
+#endif
if (!_XftDefaultInitBool (dpy, pat, FC_AUTOHINT))
goto bail1;
#ifdef FC_HINT_STYLE
@@ -470,6 +473,14 @@ XftDefaultSubstitute (Display *dpy, int screen, FcPattern *pattern)
XftDefaultGetBool (dpy, FC_ANTIALIAS, screen,
True));
}
+#ifdef FC_EMBOLDEN
+ if (FcPatternGet (pattern, FC_EMBOLDEN, 0, &v) == FcResultNoMatch)
+ {
+ FcPatternAddBool (pattern, FC_EMBOLDEN,
+ XftDefaultGetBool (dpy, FC_EMBOLDEN, screen,
+ False));
+ }
+#endif
if (FcPatternGet (pattern, FC_HINTING, 0, &v) == FcResultNoMatch)
{
FcPatternAddBool (pattern, FC_HINTING,
@@ -494,15 +505,18 @@ XftDefaultSubstitute (Display *dpy, int screen, FcPattern *pattern)
{
int subpixel = FC_RGBA_UNKNOWN;
#if RENDER_MAJOR > 0 || RENDER_MINOR >= 6
- int render_order = XRenderQuerySubpixelOrder (dpy, screen);
- switch (render_order) {
- default:
- case SubPixelUnknown: subpixel = FC_RGBA_UNKNOWN; break;
- case SubPixelHorizontalRGB: subpixel = FC_RGBA_RGB; break;
- case SubPixelHorizontalBGR: subpixel = FC_RGBA_BGR; break;
- case SubPixelVerticalRGB: subpixel = FC_RGBA_VRGB; break;
- case SubPixelVerticalBGR: subpixel = FC_RGBA_VBGR; break;
- case SubPixelNone: subpixel = FC_RGBA_NONE; break;
+ if (XftDefaultHasRender (dpy))
+ {
+ int render_order = XRenderQuerySubpixelOrder (dpy, screen);
+ switch (render_order) {
+ default:
+ case SubPixelUnknown: subpixel = FC_RGBA_UNKNOWN; break;
+ case SubPixelHorizontalRGB: subpixel = FC_RGBA_RGB; break;
+ case SubPixelHorizontalBGR: subpixel = FC_RGBA_BGR; break;
+ case SubPixelVerticalRGB: subpixel = FC_RGBA_VRGB; break;
+ case SubPixelVerticalBGR: subpixel = FC_RGBA_VBGR; break;
+ case SubPixelNone: subpixel = FC_RGBA_NONE; break;
+ }
}
#endif
FcPatternAddInteger (pattern, FC_RGBA,
diff --git a/src/xftdraw.c b/src/xftdraw.c
index 2eb3306..23b9bca 100644
--- a/src/xftdraw.c
+++ b/src/xftdraw.c
@@ -1,7 +1,7 @@
/*
- * $XFree86: xc/lib/Xft/xftdraw.c,v 1.25 2002/10/11 17:53:02 keithp Exp $
+ * $Id$
*
- * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
+ * Copyright © 2000 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -22,12 +22,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
#include "xftint.h"
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
/*
* Ok, this is a pain. To share source pictures across multiple destinations,
diff --git a/src/xftextent.c b/src/xftextent.c
index 25e096e..49db898 100644
--- a/src/xftextent.c
+++ b/src/xftextent.c
@@ -1,7 +1,7 @@
/*
- * $XFree86: xc/lib/Xft/xftextent.c,v 1.9 2002/10/11 17:53:02 keithp Exp $
+ * $Id$
*
- * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
+ * Copyright © 2000 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -22,8 +22,6 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-#include <stdlib.h>
-#include <string.h>
#include "xftint.h"
void
@@ -66,14 +64,12 @@ XftGlyphExtents (Display *dpy,
(xftg = font->glyphs[glyph]))
break;
}
- if (n == 0 && !xftg)
+ if (n == 0)
{
- extents->width = 0;
- extents->height = 0;
- extents->x = 0;
- extents->y = 0;
- extents->yOff = 0;
- extents->xOff = 0;
+ if (xftg)
+ *extents = xftg->metrics;
+ else
+ memset (extents, '\0', sizeof (*extents));
}
else
{
diff --git a/src/xftfont.c b/src/xftfont.c
index 8c28d97..ab29fbc 100644
--- a/src/xftfont.c
+++ b/src/xftfont.c
@@ -1,7 +1,7 @@
/*
- * $XFree86: xc/lib/Xft/xftfont.c,v 1.9 2002/02/15 07:36:11 keithp Exp $
+ * $Id$
*
- * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
+ * Copyright © 2000 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -22,8 +22,6 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-#include <stdio.h>
-#include <stdlib.h>
#include "xftint.h"
FcPattern *
diff --git a/src/xftfreetype.c b/src/xftfreetype.c
index 676b7e6..64e90f2 100644
--- a/src/xftfreetype.c
+++ b/src/xftfreetype.c
@@ -1,7 +1,7 @@
/*
- * $XFree86: xc/lib/Xft/xftfreetype.c,v 1.29tsi Exp $
+ * $Id$
*
- * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
+ * Copyright © 2000 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -22,11 +22,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
#include "xftint.h"
-#include <X11/Xlibint.h>
FT_Library _XftFTlibrary;
@@ -289,8 +285,8 @@ _XftReleaseFile (XftFtFile *f)
if (f->face)
FT_Done_Face (f->face);
}
- XftMemFree (XFT_MEM_FILE,
- sizeof (XftFtFile) + f->file ? strlen (f->file) + 1 : 0);
+ XftMemFree (XFT_MEM_FILE,
+ sizeof (XftFtFile) + (f->file ? strlen (f->file) + 1 : 0));
free (f);
}
@@ -528,6 +524,20 @@ XftFontInfoFill (Display *dpy, _Xconst FcPattern *pattern, XftFontInfo *fi)
goto bail1;
}
+#ifdef FC_EMBOLDEN
+ switch (FcPatternGetBool (pattern, FC_EMBOLDEN, 0, &fi->embolden)) {
+ case FcResultNoMatch:
+ fi->embolden = FcFalse;
+ break;
+ case FcResultMatch:
+ break;
+ default:
+ goto bail1;
+ }
+#else
+ fi->embolden = FcFalse;
+#endif
+
#ifdef FC_HINT_STYLE
switch (FcPatternGetInteger (pattern, FC_HINT_STYLE, 0, &hint_style)) {
case FcResultNoMatch:
@@ -747,7 +757,7 @@ XftFontOpenInfo (Display *dpy,
FT_Face face;
XftFont **bucket;
XftFontInt *font;
- XRenderPictFormat pf, *format;
+ XRenderPictFormat *format;
FcCharSet *charset;
FcChar32 num_unicode;
FcChar32 hash_value;
@@ -808,7 +818,7 @@ XftFontOpenInfo (Display *dpy,
antialias = fi->antialias;
if (!(face->face_flags & FT_FACE_FLAG_SCALABLE))
antialias = FcFalse;
-
+
/*
* Find the appropriate picture format
*/
diff --git a/src/xftglyphs.c b/src/xftglyphs.c
index a9d1ecc..9b27d01 100644
--- a/src/xftglyphs.c
+++ b/src/xftglyphs.c
@@ -1,6 +1,7 @@
/*
+ * $Id$
*
- * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
+ * Copyright © 2000 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -21,12 +22,8 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
#include "xftint.h"
#include <freetype/ftoutln.h>
-#include <fontconfig/fcfreetype.h>
static const int filters[3][3] = {
/* red */
@@ -172,6 +169,13 @@ XftFontLoadGlyphs (Display *dpy,
glyphslot = face->glyph;
+#if HAVE_FT_GLYPHSLOT_EMBOLDEN
+ /*
+ * Embolden if required
+ */
+ if (font->info.embolden) FT_GlyphSlot_Embolden(glyphslot);
+#endif
+
/*
* Compute glyph metrics from FreeType information
*/
@@ -219,10 +223,10 @@ XftFontLoadGlyphs (Display *dpy,
height = TRUNC( top - bottom );
/*
- * Try to keep monospace fonts ink-inside
+ * Clip charcell glyphs to the bounding box
* XXX transformed?
*/
- if (font->info.spacing != FC_PROPORTIONAL && !font->info.transform)
+ if (font->info.spacing >= FC_CHARCELL && !font->info.transform)
{
if (font->info.load_flags & FT_LOAD_VERTICAL_LAYOUT)
{
@@ -266,7 +270,7 @@ XftFontLoadGlyphs (Display *dpy,
xftg->metrics.x = -TRUNC(left);
xftg->metrics.y = TRUNC(top);
- if (font->info.spacing != FC_PROPORTIONAL)
+ if (font->info.spacing >= FC_MONO)
{
if (font->info.transform)
{
diff --git a/src/xftinit.c b/src/xftinit.c
index a4ad682..b210706 100644
--- a/src/xftinit.c
+++ b/src/xftinit.c
@@ -1,6 +1,7 @@
/*
+ * $Id$
*
- * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
+ * Copyright © 2000 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -21,10 +22,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-#include <stdlib.h>
-#include <stdio.h>
#include "xftint.h"
-#include <X11/Xlibint.h>
Bool _XftConfigInitialized;
diff --git a/src/xftint.h b/src/xftint.h
index 465bb2e..4149a9d 100644
--- a/src/xftint.h
+++ b/src/xftint.h
@@ -1,6 +1,7 @@
/*
+ * $Id$
*
- * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
+ * Copyright © 2000 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -26,7 +27,7 @@
* and constitute no kind of standard. If you need any of these functions,
* please drop me a note. Either the library needs new functionality,
* or there's a way to do what you need using the existing published
- * interfaces. keithp@xfree86.org
+ * interfaces. keithp@freedesktop.org
*/
#ifndef _XFTINT_H_
@@ -34,10 +35,28 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
+#else /* X monolithic tree */
+#define HAVE_STDLIB_H 1 /* assumed since all ANSI C platforms require it */
+#include <X11/Xosdefs.h> /* get string.h or strings.h as appropriate */
#endif
+#include <stdio.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#if HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
+#include <ctype.h>
+
#include <X11/Xlib.h>
+#include <X11/Xutil.h>
#include <X11/Xmd.h>
+#include <X11/Xlibint.h>
#define _XFT_NO_COMPAT_
#include "Xft.h"
#include <fontconfig/fcprivate.h>
@@ -118,6 +137,7 @@ struct _XftFontInfo {
*/
FT_F26Dot6 xsize, ysize; /* pixel size */
FcBool antialias; /* doing antialiasing */
+ FcBool embolden; /* force emboldening */
int rgba; /* subpixel order */
FT_Matrix matrix; /* glyph transformation matrix */
FcBool transform; /* non-identify matrix? */
diff --git a/src/xftlist.c b/src/xftlist.c
index edf2e52..c92607d 100644
--- a/src/xftlist.c
+++ b/src/xftlist.c
@@ -1,6 +1,7 @@
/*
+ * $Id$
*
- * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
+ * Copyright © 2000 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -21,7 +22,6 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-#include <stdlib.h>
#include "xftint.h"
FcFontSet *
diff --git a/src/xftname.c b/src/xftname.c
index cac2817..f5ce0c0 100644
--- a/src/xftname.c
+++ b/src/xftname.c
@@ -1,6 +1,7 @@
/*
+ * $Id$
*
- * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
+ * Copyright © 2000 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -22,7 +23,6 @@
*/
#include "xftint.h"
-#include <stdlib.h>
static const FcObjectType _XftObjectTypes[] = {
{ XFT_CORE, FcTypeBool, },
diff --git a/src/xftrender.c b/src/xftrender.c
index 1cf2882..4a6f343 100644
--- a/src/xftrender.c
+++ b/src/xftrender.c
@@ -1,6 +1,7 @@
/*
+ * $Id$
*
- * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
+ * Copyright © 2000 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -21,7 +22,6 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-#include <stdlib.h>
#include "xftint.h"
#define NUM_LOCAL 1024
diff --git a/src/xftstr.c b/src/xftstr.c
index 85aaf9a..914faa3 100644
--- a/src/xftstr.c
+++ b/src/xftstr.c
@@ -1,6 +1,7 @@
/*
+ * $Id$
*
- * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
+ * Copyright © 2000 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -21,9 +22,6 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
#include "xftint.h"
int
diff --git a/src/xftswap.c b/src/xftswap.c
index e60a646..dc7bcf9 100644
--- a/src/xftswap.c
+++ b/src/xftswap.c
@@ -1,6 +1,7 @@
/*
+ * $Id$
*
- * Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc.
+ * Copyright © 2002 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -21,7 +22,6 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-#include <X11/Xlib.h>
#include "xftint.h"
int
diff --git a/src/xftxlfd.c b/src/xftxlfd.c
index 55d9488..84ebe57 100644
--- a/src/xftxlfd.c
+++ b/src/xftxlfd.c
@@ -1,6 +1,7 @@
/*
+ * $Id$
*
- * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
+ * Copyright © 2000 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -21,9 +22,6 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
#include "xftint.h"
static XftSymbolic XftXlfdWeights[] = {