3 Copyright 1991, 1998 The Open Group
5 Permission to use, copy, modify, distribute, and sell this software and its
6 documentation for any purpose is hereby granted without fee, provided that
7 the above copyright notice appear in all copies and that both that
8 copyright notice and this permission notice appear in supporting
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
18 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 Except as contained in this notice, the name of The Open Group shall not be
22 used in advertising or otherwise to promote the sale, use or other dealings
23 in this Software without prior written authorization from The Open Group.
28 * Author: Keith Packard, MIT X Consortium
31 #ifndef _FONTFILEST_H_
32 #define _FONTFILEST_H_
36 #include <X11/fonts/fontmisc.h>
38 #include <X11/fonts/fontstruct.h>
39 #include <X11/fonts/fontxlfd.h>
40 #include <X11/fonts/fntfil.h>
42 typedef struct _FontName {
48 typedef struct _FontScaled {
54 typedef struct _FontScalableExtra {
55 FontScalableRec defaults;
60 } FontScalableExtraRec;
62 typedef struct _FontScalableEntry {
63 FontRendererPtr renderer;
65 FontScalableExtraPtr extra;
66 } FontScalableEntryRec;
69 * This "can't" work yet - the returned alias string must be permanent,
70 * but this layer would need to generate the appropriate name from the
71 * resolved scalable + the XLFD values passed in. XXX
74 typedef struct _FontScaleAliasEntry {
76 } FontScaleAliasEntryRec;
78 typedef struct _FontBitmapEntry {
79 FontRendererPtr renderer;
84 typedef struct _FontAliasEntry {
88 typedef struct _FontBCEntry {
93 typedef struct _FontEntry {
96 union _FontEntryParts {
97 FontScalableEntryRec scalable;
98 FontBitmapEntryRec bitmap;
99 FontAliasEntryRec alias;
104 typedef struct _FontTable {
107 FontEntryPtr entries;
111 typedef struct _FontDirectory {
113 unsigned long dir_mtime;
114 unsigned long alias_mtime;
115 FontTableRec scalable;
116 FontTableRec nonScalable;
120 /* Capability bits: for definition of capabilities bitmap in the
121 FontRendererRec to indicate support of XLFD enhancements */
123 #define CAP_MATRIX 0x1
124 #define CAP_CHARSUBSETTING 0x2
126 typedef struct _FontRenderer {
127 const char *fileSuffix;
129 int (*OpenBitmap)(FontPathElementPtr /* fpe */,
130 FontPtr * /* pFont */,
132 FontEntryPtr /* entry */,
133 char * /* fileName */,
134 fsBitmapFormat /* format */,
135 fsBitmapFormatMask /* mask */,
136 FontPtr /* non_cachable_font */);
137 int (*OpenScalable)(FontPathElementPtr /* fpe */,
138 FontPtr * /* pFont */,
140 FontEntryPtr /* entry */,
141 char * /* fileName */,
142 FontScalablePtr /* vals */,
143 fsBitmapFormat /* format */,
144 fsBitmapFormatMask /* fmask */,
145 FontPtr /* non_cachable_font */);
146 int (*GetInfoBitmap)(FontPathElementPtr /* fpe */,
147 FontInfoPtr /* pFontInfo */,
148 FontEntryPtr /* entry */,
149 char * /*fileName */);
150 int (*GetInfoScalable)(FontPathElementPtr /* fpe */,
151 FontInfoPtr /* pFontInfo */,
152 FontEntryPtr /* entry */,
153 FontNamePtr /* fontName */,
154 char * /* fileName */,
155 FontScalablePtr /* vals */);
157 int capabilities; /* Bitmap components defined above */
160 typedef struct _FontRenders {
162 struct _FontRenderersElement {
163 /* In order to preserve backward compatibility, the
164 priority field is made invisible to renderers */
165 FontRendererPtr renderer;
168 } FontRenderersRec, *FontRenderersPtr;
170 typedef struct _BitmapInstance {
171 FontScalableRec vals;
172 FontBitmapEntryPtr bitmap;
173 } BitmapInstanceRec, *BitmapInstancePtr;
175 typedef struct _BitmapScalablePrivate {
177 BitmapInstancePtr instances;
178 } BitmapScalablePrivateRec, *BitmapScalablePrivatePtr;
180 typedef struct _BitmapSources {
181 FontPathElementPtr *fpe;
184 } BitmapSourcesRec, *BitmapSourcesPtr;
186 extern BitmapSourcesRec FontFileBitmapSources;
188 /* Defines for FontFileFindNamesInScalableDir() behavior */
189 #define NORMAL_ALIAS_BEHAVIOR 0
190 #define LIST_ALIASES_AND_TARGET_NAMES (1<<0)
191 #define IGNORE_SCALABLE_ALIASES (1<<1)
193 #endif /* _FONTFILEST_H_ */