Debian Codegraph @

texk/ps2pk/ffilest.h

raw
1 /*
2 * $XConsortium: fontfilest.h,v 1.3 91/07/16 20:15:16 keith Exp $
3 *
4 * Copyright 1991 Massachusetts Institute of Technology
5 *
6 * Permission to use, copy, modify, distribute, and sell this software and its
7 * documentation for any purpose is hereby granted without fee, provided that
8 * the above copyright notice appear in all copies and that both that
9 * copyright notice and this permission notice appear in supporting
10 * documentation, and that the name of M.I.T. not be used in advertising or
11 * publicity pertaining to distribution of the software without specific,
12 * written prior permission. M.I.T. makes no representations about the
13 * suitability of this software for any purpose. It is provided "as is"
14 * without express or implied warranty.
15 *
16 * M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL M.I.T.
18 * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
20 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
21 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 *
23 * Author: Keith Packard, MIT X Consortium
24 */
25
26 #ifndef _FONTFILEST_H_
27 #define _FONTFILEST_H_
28
29 #ifdef XSERVER
30 #include <X11/Xos.h>
31 #else
32 #include "types.h"
33 #include "Xstuff.h"
34 #endif
35
36 #include "fontmisc.h"
37 #include "fontstruct.h"
38 #include "fontfile.h"
39 #include "fontxlfd.h"
40
41 typedef struct _FontName {
42 const char *name;
43 short length;
44 short ndashes;
45 } FontNameRec;
46
47 typedef struct _FontScaled {
48 FontScalableRec vals;
49 FontEntryPtr bitmap;
50 FontPtr pFont;
51 } FontScaledRec;
52
53 typedef struct _FontScalableExtra {
54 FontScalableRec defaults;
55 int numScaled;
56 int sizeScaled;
57 FontScaledPtr scaled;
58 pointer private;
59 } FontScalableExtraRec;
60
61 typedef struct _FontScalableEntry {
62 FontRendererPtr renderer;
63 char *fileName;
64 FontScalableExtraPtr extra;
65 } FontScalableEntryRec;
66
67 /*
68 * This "can't" work yet - the returned alias string must be permanent,
69 * but this layer would need to generate the appropriate name from the
70 * resolved scalable + the XLFD values passed in. XXX
71 */
72
73 typedef struct _FontScaleAliasEntry {
74 char *resolved;
75 } FontScaleAliasEntryRec;
76
77 typedef struct _FontBitmapEntry {
78 FontRendererPtr renderer;
79 char *fileName;
80 FontPtr pFont;
81 } FontBitmapEntryRec;
82
83 typedef struct _FontAliasEntry {
84 char *resolved;
85 } FontAliasEntryRec;
86
87 typedef struct _FontBCEntry {
88 FontScalableRec vals;
89 FontEntryPtr entry;
90 } FontBCEntryRec;
91
92 typedef struct _FontEntry {
93 FontNameRec name;
94 int type;
95 union _FontEntryParts {
96 FontScalableEntryRec scalable;
97 FontBitmapEntryRec bitmap;
98 FontAliasEntryRec alias;
99 FontBCEntryRec bc;
100 } u;
101 } FontEntryRec;
102
103 typedef struct _FontTable {
104 int used;
105 int size;
106 FontEntryPtr entries;
107 Bool sorted;
108 } FontTableRec;
109
110 typedef struct _FontDirectory {
111 char *directory;
112 uint32_t dir_mtime;
113 uint32_t alias_mtime;
114 FontTableRec scalable;
115 FontTableRec nonScalable;
116 } FontDirectoryRec;
117
118 typedef struct _FontRenderer {
119 const char *fileSuffix;
120 int fileSuffixLen;
121 int (*OpenBitmap)(/* fpe, pFont, flags, entry, fileName, format, fmask */);
122 int (*OpenScalable)(/* fpe, pFont, flags, entry, fileName, vals, format, fmask */);
123 int (*GetInfoBitmap)(/* fpe, pFontInfo, entry, fileName */);
124 int (*GetInfoScalable)(/* fpe, pFontInfo, entry, fileName, vals */);
125 int number;
126 } FontRendererRec;
127
128 typedef struct _FontRenders {
129 int number;
130 FontRendererPtr *renderers;
131 } FontRenderersRec, *FontRenderersPtr;
132
133 typedef struct _BitmapInstance {
134 FontScalableRec vals;
135 FontBitmapEntryPtr bitmap;
136 } BitmapInstanceRec, *BitmapInstancePtr;
137
138 typedef struct _BitmapScalablePrivate {
139 int numInstances;
140 BitmapInstancePtr instances;
141 } BitmapScalablePrivateRec, *BitmapScalablePrivatePtr;
142
143 typedef struct _BitmapSources {
144 FontPathElementPtr *fpe;
145 int size;
146 int count;
147 } BitmapSourcesRec, *BitmapSourcesPtr;
148
149 extern BitmapSourcesRec FontFileBitmapSources;
150
151 extern void Type1CloseFont(FontPtr);
152
153 #endif /* _FONTFILEST_H_ */