1 /* $XConsortium: spint.h /main/12 1996/09/28 16:47:40 rws $ */
3 * Copyright 1990, 1991 Network Computing Devices;
4 * Portions Copyright 1987 by Digital Equipment Corporation
6 * Permission to use, copy, modify, distribute, and sell this software and
7 * its documentation for any purpose is hereby granted without fee, provided
8 * that 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 names of Network Computing Devices or Digital
11 * not be used in advertising or publicity pertaining to distribution of
12 * the software without specific, written prior permission.
14 * NETWORK COMPUTING DEVICES AND DIGITAL DISCLAIM ALL WARRANTIES WITH
15 * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
16 * AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES OR DIGITAL BE
17 * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
18 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
19 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
20 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
25 Copyright (c) 1987 X Consortium
27 Permission is hereby granted, free of charge, to any person obtaining
28 a copy of this software and associated documentation files (the
29 "Software"), to deal in the Software without restriction, including
30 without limitation the rights to use, copy, modify, merge, publish,
31 distribute, sublicense, and/or sell copies of the Software, and to
32 permit persons to whom the Software is furnished to do so, subject to
33 the following conditions:
35 The above copyright notice and this permission notice shall be included
36 in all copies or substantial portions of the Software.
38 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
39 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
40 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
41 IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
42 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
43 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
44 OTHER DEALINGS IN THE SOFTWARE.
46 Except as contained in this notice, the name of the X Consortium shall
47 not be used in advertising or otherwise to promote the sale, use or
48 other dealings in this Software without prior written authorization
49 from the X Consortium.
58 #include <X11/Xfuncproto.h>
61 #define SaveMetrics 0x1
62 #define ComputeBoundsOnly 0x2
64 #define GLWIDTHBYTESPADDED(bits,nbytes) \
65 ((nbytes) == 1 ? (((bits)+7)>>3) /* pad to 1 byte */ \
66 :(nbytes) == 2 ? ((((bits)+15)>>3)&~1) /* pad to 2 bytes */ \
67 :(nbytes) == 4 ? ((((bits)+31)>>3)&~3) /* pad to 4 bytes */ \
68 :(nbytes) == 8 ? ((((bits)+63)>>3)&~7) /* pad to 8 bytes */ \
71 #define GLYPH_SIZE(ch, nbytes) \
72 GLWIDTHBYTESPADDED((ch)->metrics.rightSideBearing - \
73 (ch)->metrics.leftSideBearing, (nbytes))
75 #define mincharno(p) ((p).min_char_low + ((p).min_char_high << 8))
76 #define maxcharno(p) ((p).max_char_low + ((p).max_char_high << 8))
78 #define MasterFileOpen 0x1
80 typedef struct _sp_master {
81 FontEntryPtr entry; /* back pointer */
94 int state; /* open, closed */
95 int refcount; /* number of instances */
98 } SpeedoMasterFontRec, *SpeedoMasterFontPtr;
100 typedef struct _cur_font_stats {
101 fsBitmapFormat format;
102 /* current glyph info */
112 * since Speedo returns extents that are not identical to what it feeds to
113 * the bitmap builder, and we want to be able to use the extents for
114 * preformance reasons, some of the bitmaps require padding out. the next
115 * two flags keep track of this.
122 } CurrentFontValuesRec, *CurrentFontValuesPtr;
125 typedef struct _sp_font {
126 struct _sp_master *master;
131 FontScalableRec vals;
133 /* char & metric data */
134 CharInfoPtr encoding;
135 CharInfoPtr pDefault;
139 unsigned long bitmap_size;
142 } SpeedoFontRec, *SpeedoFontPtr;
144 extern SpeedoFontPtr sp_fp_cur;
146 extern int sp_open_font();
147 extern int sp_open_master();
148 extern void sp_close_font();
149 extern void sp_close_master_font();
150 extern void sp_close_master_file();
151 extern void sp_reset_master();
152 #if NeedVarargsPrototypes
153 extern void SpeedoErr(char *fmt, ...);
155 extern void SpeedoErr();
158 extern void sp_make_standard_props();
159 extern void sp_make_header();
160 extern void sp_compute_bounds();
161 extern void sp_compute_props();
162 extern int sp_build_all_bitmaps();
163 extern unsigned long sp_compute_data_size();
165 extern int sp_bics_map[];
166 extern int sp_bics_map_size;
169 extern int adobe_map[];
170 extern int adobe_map_size;
174 #endif /* _SPINT_H_ */