Debian Codegraph @

include/X11/fonts/fntfilst.h

raw
1 /*
2
3 Copyright 1991, 1998 The Open Group
4
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
9 documentation.
10
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
13
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.
20
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.
24
25 */
26
27 /*
28 * Author: Keith Packard, MIT X Consortium
29 */
30
31 #ifndef _FONTFILEST_H_
32 #define _FONTFILEST_H_
33
34 #include <X11/Xos.h>
35 #ifndef XP_PSTEXT
36 #include <X11/fonts/fontmisc.h>
37 #endif
38 #include <X11/fonts/fontstruct.h>
39 #include <X11/fonts/fontxlfd.h>
40 #include <X11/fonts/fntfil.h>
41
42 typedef struct _FontName {
43 char *name;
44 short length;
45 short ndashes;
46 } FontNameRec;
47
48 typedef struct _FontScaled {
49 FontScalableRec vals;
50 FontEntryPtr bitmap;
51 FontPtr pFont;
52 } FontScaledRec;
53
54 typedef struct _FontScalableExtra {
55 FontScalableRec defaults;
56 int numScaled;
57 int sizeScaled;
58 FontScaledPtr scaled;
59 pointer private;
60 } FontScalableExtraRec;
61
62 typedef struct _FontScalableEntry {
63 FontRendererPtr renderer;
64 char *fileName;
65 FontScalableExtraPtr extra;
66 } FontScalableEntryRec;
67
68 /*
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
72 */
73
74 typedef struct _FontScaleAliasEntry {
75 char *resolved;
76 } FontScaleAliasEntryRec;
77
78 typedef struct _FontBitmapEntry {
79 FontRendererPtr renderer;
80 char *fileName;
81 FontPtr pFont;
82 } FontBitmapEntryRec;
83
84 typedef struct _FontAliasEntry {
85 char *resolved;
86 } FontAliasEntryRec;
87
88 typedef struct _FontEntry {
89 FontNameRec name;
90 int type;
91 union _FontEntryParts {
92 FontScalableEntryRec scalable;
93 FontBitmapEntryRec bitmap;
94 FontAliasEntryRec alias;
95 } u;
96 } FontEntryRec;
97
98 typedef struct _FontTable {
99 int used;
100 int size;
101 FontEntryPtr entries;
102 Bool sorted;
103 } FontTableRec;
104
105 typedef struct _FontDirectory {
106 char *directory;
107 unsigned long dir_mtime;
108 unsigned long alias_mtime;
109 FontTableRec scalable;
110 FontTableRec nonScalable;
111 char *attributes;
112 } FontDirectoryRec;
113
114 /* Capability bits: for definition of capabilities bitmap in the
115 FontRendererRec to indicate support of XLFD enhancements */
116
117 #define CAP_MATRIX 0x1
118 #define CAP_CHARSUBSETTING 0x2
119
120 typedef struct _FontRenderer {
121 const char *fileSuffix;
122 int fileSuffixLen;
123 int (*OpenBitmap)(FontPathElementPtr /* fpe */,
124 FontPtr * /* pFont */,
125 int /* flags */,
126 FontEntryPtr /* entry */,
127 char * /* fileName */,
128 fsBitmapFormat /* format */,
129 fsBitmapFormatMask /* mask */,
130 FontPtr /* non_cachable_font */);
131 int (*OpenScalable)(FontPathElementPtr /* fpe */,
132 FontPtr * /* pFont */,
133 int /* flags */,
134 FontEntryPtr /* entry */,
135 char * /* fileName */,
136 FontScalablePtr /* vals */,
137 fsBitmapFormat /* format */,
138 fsBitmapFormatMask /* fmask */,
139 FontPtr /* non_cachable_font */);
140 int (*GetInfoBitmap)(FontPathElementPtr /* fpe */,
141 FontInfoPtr /* pFontInfo */,
142 FontEntryPtr /* entry */,
143 char * /*fileName */);
144 int (*GetInfoScalable)(FontPathElementPtr /* fpe */,
145 FontInfoPtr /* pFontInfo */,
146 FontEntryPtr /* entry */,
147 FontNamePtr /* fontName */,
148 char * /* fileName */,
149 FontScalablePtr /* vals */);
150 int number;
151 int capabilities; /* Bitmap components defined above */
152 } FontRendererRec;
153
154 typedef struct _FontRenders {
155 int number;
156 struct _FontRenderersElement {
157 /* In order to preserve backward compatibility, the
158 priority field is made invisible to renderers */
159 FontRendererPtr renderer;
160 int priority;
161 } *renderers;
162 } FontRenderersRec, *FontRenderersPtr;
163
164 typedef struct _BitmapInstance {
165 FontScalableRec vals;
166 FontBitmapEntryPtr bitmap;
167 } BitmapInstanceRec, *BitmapInstancePtr;
168
169 typedef struct _BitmapScalablePrivate {
170 int numInstances;
171 BitmapInstancePtr instances;
172 } BitmapScalablePrivateRec, *BitmapScalablePrivatePtr;
173
174 typedef struct _BitmapSources {
175 FontPathElementPtr *fpe;
176 int size;
177 int count;
178 } BitmapSourcesRec, *BitmapSourcesPtr;
179
180 extern BitmapSourcesRec FontFileBitmapSources;
181
182 /* Defines for FontFileFindNamesInScalableDir() behavior */
183 #define NORMAL_ALIAS_BEHAVIOR 0
184 #define LIST_ALIASES_AND_TARGET_NAMES (1<<0)
185 #define IGNORE_SCALABLE_ALIASES (1<<1)
186
187 #endif /* _FONTFILEST_H_ */