Commit 403c9f98 authored by Alan Coopersmith's avatar Alan Coopersmith

Sync with Xft from xlibs CVS (2.1.7 plus man page updates from Branden

    Robinson) - see lib/Xft/ChangeLog for full details
parent 1d14cc37
Keith Packard, of SuSE, HP, and XFree86
Keith Packard, of SuSE and HP
Automake work by Noah Levitt
Frank Giessler - OS/2
......
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
/*
* $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
......
/*
* $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
......
This diff is collapsed.
.\" 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
/*
* $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
......
/*
* $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,
......
/*
* $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
......
/*
* $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,
......
/*
* $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,
......
/*
* $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
{
......
/*
* $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 *
......
/*
* $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
*/
......
/*
* $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)
{
......
/*
* $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;
......
/*
* $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