1/*
2 * Copyright © 2001 Keith Packard
3 *
4 * Permission to use, copy, modify, distribute, and sell this software and its
5 * documentation for any purpose is hereby granted without fee, provided that
6 * the above copyright notice appear in all copies and that both that
7 * copyright notice and this permission notice appear in supporting
8 * documentation, and that the name of Keith Packard not be used in
9 * advertising or publicity pertaining to distribution of the software without
10 * specific, written prior permission.  Keith Packard makes no
11 * representations about the suitability of this software for any purpose.  It
12 * is provided "as is" without express or implied warranty.
13 *
14 * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
16 * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
17 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
18 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
19 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
20 * PERFORMANCE OF THIS SOFTWARE.
21 */
22
23#ifndef _XFTCOMPAT_H_
24#define _XFTCOMPAT_H_
25#include <X11/Xfuncproto.h>
26
27/*
28 * Compatibility definitions -- map Fc names to Xft names
29 */
30
31typedef FcChar8	    XftChar8;
32typedef FcChar16    XftChar16;
33typedef FcChar32    XftChar32;
34
35#define XFT_FAMILY	FC_FAMILY
36#define XFT_STYLE	FC_STYLE
37#define XFT_SLANT	FC_SLANT
38#define XFT_WEIGHT	FC_WEIGHT
39#define XFT_SIZE	FC_SIZE
40#define XFT_PIXEL_SIZE	FC_PIXEL_SIZE
41#define XFT_SPACING	FC_SPACING
42#define XFT_FOUNDRY	FC_FOUNDRY
43#define XFT_ANTIALIAS	FC_ANTIALIAS
44#define XFT_FILE	FC_FILE
45#define XFT_INDEX	FC_INDEX
46#define XFT_RASTERIZER	FC_RASTERIZER
47#define XFT_OUTLINE	FC_OUTLINE
48#define XFT_SCALABLE	FC_SCALABLE
49#define XFT_RGBA	FC_RGBA
50
51/* defaults from resources */
52#define XFT_SCALE	FC_SCALE
53#define XFT_MINSPACE	FC_MINSPACE
54#define XFT_DPI		FC_DPI
55
56/* specific to FreeType rasterizer */
57#define XFT_CHAR_WIDTH	FC_CHAR_WIDTH
58#define XFT_CHAR_HEIGHT	FC_CHAR_HEIGHT
59#define XFT_MATRIX	FC_MATRIX
60
61#define XFT_WEIGHT_LIGHT	FC_WEIGHT_LIGHT
62#define XFT_WEIGHT_MEDIUM	FC_WEIGHT_MEDIUM
63#define XFT_WEIGHT_DEMIBOLD	FC_WEIGHT_DEMIBOLD
64#define XFT_WEIGHT_BOLD		FC_WEIGHT_BOLD
65#define XFT_WEIGHT_BLACK	FC_WEIGHT_BLACK
66
67#define XFT_SLANT_ROMAN		FC_SLANT_ROMAN
68#define XFT_SLANT_ITALIC	FC_SLANT_ITALIC
69#define XFT_SLANT_OBLIQUE	FC_SLANT_OBLIQUE
70
71#define XFT_PROPORTIONAL	FC_PROPORTIONAL
72#define XFT_MONO		FC_MONO
73#define XFT_CHARCELL		FC_CHARCELL
74
75#define XFT_RGBA_UNKNOWN	FC_RGBA_UNKNOWN
76#define XFT_RGBA_RGB		FC_RGBA_RGB
77#define XFT_RGBA_BGR		FC_RGBA_BGR
78#define XFT_RGBA_VRGB		FC_RGBA_VRGB
79#define XFT_RGBA_VBGR		FC_RGBA_VBGR
80#define XFT_RGBA_NONE		FC_RGBA_NONE
81
82/*
83 * Old constants
84 */
85#define XFT_ENCODING		"encoding"
86
87typedef FcType XftType;
88
89typedef FcMatrix XftMatrix;
90
91#define XftMatrixInit(m)	FcMatrixInit(m)
92
93typedef FcResult    XftResult;
94
95#define XftResultMatch		FcResultMatch
96#define XftResultNoMatch	FcResultNoMatch
97#define XftResultTypeMismatch	FcResultTypeMismatch
98#define XftResultNoId		FcResultNoId
99
100typedef FcValue		XftValue;
101typedef FcPattern	XftPattern;
102typedef FcFontSet	XftFontSet;
103typedef FcObjectSet	XftObjectSet;
104
105#define XftGlyphExists		XftCharExists
106
107#define XftObjectSetCreate	FcObjectSetCreate
108#define XftObjectSetAdd		FcObjectSetAdd
109#define XftObjectSetDestroy	FcObjectSetDestroy
110#define XftObjectSetVaBuild	FcObjectSetVaBuild
111#define XftObjectSetBuild	FcObjectSetBuild
112
113#define XftFontSetMatch		FcFontSetMatch
114#define XftFontSetDestroy	FcFontSetDestroy
115
116#define XftMatrixEqual		FcMatrixEqual
117#define XftMatrixMultiply	FcMatrixMultiply
118#define XftMatrixRotate		FcMatrixRotate
119#define XftMatrixScale		FcMatrixScale
120#define XftMatrixShear		FcMatrixShear
121
122#define XftPatternCreate	FcPatternCreate
123#define XftPatternDuplicate	FcPatternDuplicate
124#define XftValueDestroy		FcValueDestroy
125#define XftValueListDestroy	FcValueListDestroy
126#define XftPatternDestroy	FcPatternDestroy
127#define XftPatternFind		FcPatternFind
128#define XftPatternAdd		FcPatternAdd
129#define XftPatternGet		FcPatternGet
130#define XftPatternDel		FcPatternDel
131#define XftPatternAddInteger	FcPatternAddInteger
132#define XftPatternAddDouble	FcPatternAddDouble
133#define XftPatternAddString(p,e,s)	FcPatternAddString(p,e,(FcChar8 *)(s))
134#define XftPatternAddMatrix	FcPatternAddMatrix
135#define XftPatternAddBool	FcPatternAddBool
136#define XftPatternGetInteger	FcPatternGetInteger
137#define XftPatternGetDouble	FcPatternGetDouble
138#define XftPatternGetString(p,e,i,n)	FcPatternGetString(p,e,i,(FcChar8 **) (n))
139#define XftPatternGetMatrix	FcPatternGetMatrix
140#define XftPatternGetBool	FcPatternGetBool
141#define XftPatternVaBuild	FcPatternVaBuild
142#define XftPatternBuild		FcPatternBuild
143
144#define XftUtf8ToUcs4		FcUtf8ToUcs4
145#define XftUtf8Len		FcUtf8Len
146
147#define XftTypeVoid	FcTypeVoid
148#define XftTypeInteger	FcTypeInteger
149#define XftTypeDouble	FcTypeDouble
150#define XftTypeString	FcTypeString
151#define XftTypeBool	FcTypeBool
152#define XftTypeMatrix	FcTypeMatrix
153
154#define XftConfigSubstitute(p) FcConfigSubstitute (0, p, FcMatchPattern)
155
156#endif /* _XFTCOMPAT_H_ */
157