]> git.sesse.net Git - rdpsrv/blob - Xserver/lib/font/Speedo/spdo_prv.h
Import X server from vnc-3.3.7.
[rdpsrv] / Xserver / lib / font / Speedo / spdo_prv.h
1 /* $XConsortium: spdo_prv.h,v 1.4 94/02/10 11:06:01 gildea Exp $ */
2
3 /*
4
5 Copyright 1989-1991, Bitstream Inc., Cambridge, MA.
6 You are hereby granted permission under all Bitstream propriety rights to
7 use, copy, modify, sublicense, sell, and redistribute the Bitstream Speedo
8 software and the Bitstream Charter outline font for any purpose and without
9 restrictions; provided, that this notice is left intact on all copies of such
10 software or font and that Bitstream's trademark is acknowledged as shown below
11 on all unmodified copies of such font.
12
13 BITSTREAM CHARTER is a registered trademark of Bitstream Inc.
14
15
16 BITSTREAM INC. DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
17 WITHOUT LIMITATION THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
18 PARTICULAR PURPOSE.  BITSTREAM SHALL NOT BE LIABLE FOR ANY DIRECT OR INDIRECT
19 DAMAGES, INCLUDING BUT NOT LIMITED TO LOST PROFITS, LOST DATA, OR ANY OTHER
20 INCIDENTAL OR CONSEQUENTIAL DAMAGES, ARISING OUT OF OR IN ANY WAY CONNECTED
21 WITH THE SPEEDO SOFTWARE OR THE BITSTREAM CHARTER OUTLINE FONT.
22
23 */
24
25
26
27 /***************************** S P D O _ P R V . H *******************************/
28  
29 #include "speedo.h"  /* include public definitions */
30
31 /*****  CONFIGURATION DEFINITIONS *****/
32
33
34 #ifndef INCL_PLAID_OUT
35 #define  INCL_PLAID_OUT 0          /* 1 to include plaid data monitoring */
36 #endif                             /* 0 to omit plaid data monitoring */
37
38
39 /***** PRIVATE FONT HEADER OFFSET CONSTANTS  *****/
40 #define  FH_ORUMX    0      /* U   Max ORU value  2 bytes                   */
41 #define  FH_PIXMX    2      /* U   Max Pixel value  2 bytes                 */
42 #define  FH_CUSNR    4      /* U   Customer Number  2 bytes                 */
43 #define  FH_OFFCD    6      /* E   Offset to Char Directory  3 bytes        */
44 #define  FH_OFCNS    9      /* E   Offset to Constraint Data  3 bytes       */
45 #define  FH_OFFTK   12      /* E   Offset to Track Kerning  3 bytes         */
46 #define  FH_OFFPK   15      /* E   Offset to Pair Kerning  3 bytes          */
47 #define  FH_OCHRD   18      /* E   Offset to Character Data  3 bytes        */
48 #define  FH_NBYTE   21      /* E   Number of Bytes in File  3 bytes         */
49
50
51 /***** MODE FLAGS CONSTANTS *****/
52 #define CURVES_OUT     0X0008  /* Output module accepts curves              */
53 #define BOGUS_MODE     0X0010  /* Linear scaling mode                       */
54 #define CONSTR_OFF     0X0020  /* Inhibit constraint table                  */
55 #define IMPORT_WIDTHS  0X0040  /* Imported width mode                       */
56 #define SQUEEZE_LEFT   0X0100  /* Squeeze left mode                         */
57 #define SQUEEZE_RIGHT  0X0200  /* Squeeze right mode                        */
58 #define SQUEEZE_TOP    0X0400  /* Squeeze top mode                          */
59 #define SQUEEZE_BOTTOM 0X0800  /* Squeeze bottom mode                       */
60 #define CLIP_LEFT      0X1000  /* Clip left mode                            */
61 #define CLIP_RIGHT     0X2000  /* Clip right mode                           */
62 #define CLIP_TOP       0X4000  /* Clip top mode                             */
63 #define CLIP_BOTTOM    0X8000  /* Clip bottom mode                          */
64
65
66 /***** MACRO DEFINITIONS *****/
67
68 #define SQUEEZE_MULT(A,B) (((fix31)A * (fix31)B) / (1 << 16))
69
70 #define NEXT_BYTE(A) (*(A)++)
71
72 #define NEXT_WORD(A) \
73     ((fix15)(sp_globals.key32 ^ ((A) += 2, \
74                                  ((fix15)((A)[-1]) << 8) | (fix15)((A)[-2]) | \
75                                  ((A)[-1] & 0x80? ~0xFFFF : 0))))
76
77 #if INCL_EXT                       /* Extended fonts supported? */
78
79 #define NEXT_BYTES(A, B) \
80     (((B = (ufix16)(*(A)++) ^ sp_globals.key7) >= 248)? \
81      ((ufix16)(B & 0x07) << 8) + ((*(A)++) ^ sp_globals.key8) + 248: \
82      B)
83
84 #else                              /* Compact fonts only supported? */
85
86 #define NEXT_BYTES(A, B) ((*(A)++) ^ sp_globals.key7)
87
88 #endif
89
90
91 #define NEXT_BYTE_U(A) (*(A)++) 
92
93 #define NEXT_WORD_U(A, B) \
94     (fix15)(B = (*(A)++) << 8, (fix15)(*(A)++) + B)
95
96 #define NEXT_CHNDX(A, B) \
97     ((B)? (ufix16)NEXT_WORD(A): (ufix16)NEXT_BYTE(A))
98
99 /* Multiply (fix15)X by (fix15)Y to produce (fix31)product */
100 #define MULT16(X, Y) \
101     ((fix31)X * (fix31)Y)
102
103 /* Multiply (fix15)X by (fix15)MULT, add (fix31)OFFSET, 
104  * shift right SHIFT bits to produce (fix15)result */
105 #define TRANS(X, MULT, OFFSET, SHIFT) \
106     ((fix15)((((fix31)X * (fix31)MULT) + OFFSET) / (1 << SHIFT)))
107
108 /******************************************************************************
109  *
110  *      the following block of definitions redefines every function
111  *      reference to be prefixed with an "sp_".  In addition, if this 
112  *      is a reentrant version, the parameter sp_globals will be added
113  *      as the first parameter.
114  *
115  *****************************************************************************/
116
117 #if STATIC_ALLOC || DYNAMIC_ALLOC
118
119 #define GDECL
120
121 #define get_char_id(char_index) sp_get_char_id(char_index)
122 #define get_char_width(char_index) sp_get_char_width(char_index)
123 #define get_track_kern(track,point_size) sp_get_track_kern(track,point_size)
124 #define get_pair_kern(char_index1,char_index2) sp_get_pair_kern(char_index1,char_index2)
125 #define get_char_bbox(char_index,bbox) sp_get_char_bbox(char_index,bbox)
126 #define make_char(char_index) sp_make_char(char_index)
127 #if INCL_ISW
128 #define compute_isw_scale() sp_compute_isw_scale()
129 #define do_make_char(char_index) sp_do_make_char(char_index)
130 #define make_char_isw(char_index,imported_width) sp_make_char_isw(char_index,imported_width)
131 #define reset_xmax(xmax) sp_reset_xmax(xmax)
132 #endif
133 #if INCL_ISW || INCL_SQUEEZING
134 #define preview_bounding_box(pointer,format) sp_preview_bounding_box(pointer,format)
135 #endif
136 #define make_simp_char(pointer,format) sp_make_simp_char(pointer,format)
137 #define make_comp_char(pointer) sp_make_comp_char(pointer)
138 #define get_char_org(char_index,top_level) sp_get_char_org(char_index,top_level)
139 #define get_posn_arg(ppointer,format) sp_get_posn_arg(ppointer,format)
140 #define get_scale_arg(ppointer,format) sp_get_scale_arg(ppointer,format)
141 #define read_bbox(ppointer,pPmin,pPmax,set_flag) sp_read_bbox(ppointer,pPmin,pPmax,set_flag)
142 #define proc_outl_data(pointer) sp_proc_outl_data(pointer)
143 #define split_curve(P1,P2,P3,depth) sp_split_curve(P1,P2,P3,depth)
144 #define get_args(ppointer,format,pP) sp_get_args(ppointer,format,pP)
145
146 #define init_black(specsarg) sp_init_black(specsarg)
147 #define begin_char_black(Psw,Pmin,Pmax) sp_begin_char_black(Psw,Pmin,Pmax)
148 #define begin_contour_black(P1,outside) sp_begin_contour_black(P1,outside)
149 #define line_black(P1) sp_line_black(P1)
150 #define end_char_black() sp_end_char_black()
151 #define add_intercept_black(y,x) sp_add_intercept_black(y,x)
152 #define proc_intercepts_black() sp_proc_intercepts_black()
153
154 #define init_screen(specsarg) sp_init_screen(specsarg)
155 #define begin_char_screen(Psw,Pmin,Pmax) sp_begin_char_screen(Psw,Pmin,Pmax)
156 #define begin_contour_screen(P1,outside) sp_begin_contour_screen(P1,outside)
157 #define curve_screen(P1,P2,P3,depth) sp_curve_screen(P1,P2,P3,depth)
158 #define scan_curve_screen(X0,Y0,X1,Y1,X2,Y2,X3,Y3) sp_scan_curve_screen(X0,Y0,X1,Y1,X2,Y2,X3,Y3) 
159 #define vert_line_screen(x,y1,y2) sp_vert_line_screen(x,y1,y2)
160 #define line_screen(P1) sp_line_screen(P1)
161 #define end_contour_screen() sp_end_contour_screen()
162 #define end_char_screen() sp_end_char_screen()
163 #define add_intercept_screen(y,x) sp_add_intercept_screen(y,x)
164 #define proc_intercepts_screen() sp_proc_intercepts_screen()
165
166 #define init_outline(specsarg) sp_init_outline(specsarg)
167 #define begin_char_outline(Psw,Pmin,Pmax) sp_begin_char_outline(Psw,Pmin,Pmax)
168 #define begin_sub_char_outline(Psw,Pmin,Pmax) sp_begin_sub_char_outline(Psw,Pmin,Pmax)
169 #define begin_contour_outline(P1,outside) sp_begin_contour_outline(P1,outside)
170 #define curve_outline(P1,P2,P3,depth) sp_curve_outline(P1,P2,P3,depth)
171 #define line_outline(P1) sp_line_outline(P1)
172 #define end_contour_outline() sp_end_contour_outline()
173 #define end_sub_char_outline() sp_end_sub_char_outline()
174 #define end_char_outline() sp_end_char_outline()
175
176 #define init_2d(specsarg) sp_init_2d(specsarg)
177 #define begin_char_2d(Psw, Pmin, Pmax) sp_begin_char_2d(Psw, Pmin, Pmax)
178 #define begin_contour_2d(P1, outside) sp_begin_contour_2d(P1, outside)
179 #define line_2d(P1) sp_line_2d(P1)
180 #define end_char_2d() sp_end_char_2d()
181 #define add_intercept_2d(y, x) sp_add_intercept_2d(y, x)
182 #define proc_intercepts_2d() sp_proc_intercepts_2d()
183 #define draw_vector_to_2d(x0, y0, x1, y1, band) sp_draw_vector_to_2d(x0, y0, x1, y1, band)
184
185 #define init_char_out(Psw,Pmin,Pmax) sp_init_char_out(Psw,Pmin,Pmax)
186 #define begin_sub_char_out(Psw,Pmin,Pmax) sp_begin_sub_char_out(Psw,Pmin,Pmax)
187 #define curve_out(P1,P2,P3,depth) sp_curve_out(P1,P2,P3,depth)
188 #define end_contour_out() sp_end_contour_out()
189 #define end_sub_char_out() sp_end_sub_char_out()
190 #define init_intercepts_out() sp_init_intercepts_out()
191 #define restart_intercepts_out() sp_restart_intercepts_out()
192 #define set_first_band_out(Pmin,Pmax) sp_set_first_band_out(Pmin,Pmax)
193 #define reduce_band_size_out() sp_reduce_band_size_out()
194 #define next_band_out() sp_next_band_out()
195
196 #define init_userout(specsarg) sp_init_userout(specsarg)
197
198 #define reset() sp_reset()
199 #define set_key(key) sp_set_key(key)
200 #define get_cust_no(font_buff) sp_get_cust_no(font_buff)
201 #define set_specs(specsarg) sp_set_specs(specsarg)
202 #define setup_consts(xmin,xmax,ymin,ymax) sp_setup_consts(xmin,xmax,ymin,ymax)
203 #define setup_tcb(ptcb) sp_setup_tcb(ptcb)
204 #define setup_mult(input_mult) sp_setup_mult(input_mult)
205 #define setup_offset(input_offset) sp_setup_offset(input_offset)
206 #define type_tcb(ptcb) sp_type_tcb(ptcb)
207 #define read_long(pointer) sp_read_long(pointer)
208 #define read_word_u(pointer) sp_read_word_u(pointer)
209 #define init_tcb() sp_init_tcb()
210 #define scale_tcb(ptcb,x_pos,y_pos,x_scale,y_scale) sp_scale_tcb(ptcb,x_pos,y_pos,x_scale,y_scale)
211 #define plaid_tcb(ppointer,format) sp_plaid_tcb(ppointer,format)
212 #define skip_orus(ppointer,short_form,no_ctrl_zones) sp_skip_orus(ppointer,short_form,no_ctrl_zones)
213 #define skip_interpolation_table(ppointer,format) sp_skip_interpolation_table(ppointer,format)
214 #define skip_control_zone(ppointer,format) sp_skip_control_zone(ppointer,format)
215 #define constr_update() sp_constr_update()
216 #define read_oru_table(ppointer) sp_read_oru_table(ppointer)
217 #define calculate_x_pix(start_edge,end_edge,constr_nr,x_scale,x_offset,ppo,setwidth_pix) sp_calculate_x_pix(start_edge,end_edge,constr_nr,x_scale,x_offset,ppo,setwidth_pix)
218 #define calculate_y_pix(start_edge,end_edge,constr_nr,top_scale,bottom_scale,ppo,emtop_pix,embot_pix) sp_calculate_y_pix(start_edge,end_edge,constr_nr,top_scale,bottom_scale,ppo,emtop_pix,embot_pix)
219 #define calculate_x_scale(x_factor,x_offset,no_x_ctrl_zones) sp_calculate_x_scale(x_factor,x_offset,no_x_ctrl_zones)
220 #define calculate_y_scale(top_scale,bottom_scale,first_y_zone,no_Y_ctrl_zones) sp_calculate_y_scale(top_scale,bottom_scale,first_y_zone,no_Y_ctrl_zones) 
221 #define setup_pix_table(ppointer,short_form,no_X_ctrl_zones,no_Y_ctrl_zones) sp_setup_pix_table(ppointer,short_form,no_X_ctrl_zones,no_Y_ctrl_zones)
222 #define setup_int_table(ppointer,no_X_int_zones, no_Y_int_zones) sp_setup_int_table(ppointer,no_X_int_zones, no_Y_int_zones)
223
224 #define fn_init_out(specsarg) (*sp_globals.init_out)(specsarg)  
225 #define fn_begin_char(Psw,Pmin,Pmax) (*sp_globals.begin_char)(Psw,Pmin,Pmax)
226 #define fn_begin_sub_char(Psw,Pmin,Pmax) (*sp_globals.begin_sub_char)(Psw,Pmin,Pmax)
227 #define fn_end_sub_char() (*sp_globals.end_sub_char)()
228 #define fn_end_char() (*sp_globals.end_char)()
229 #define fn_line(P1) (*sp_globals.line)(P1)
230 #define fn_end_contour() (*sp_globals.end_contour)()
231 #define fn_begin_contour(P0,fmt) (*sp_globals.begin_contour)(P0,fmt)
232 #define fn_curve(P1,P2,P3,depth) (*sp_globals.curve)(P1,P2,P3,depth)
233
234 #define load_char_data(offset, no_bytes, buff_off) sp_load_char_data(offset, no_bytes, buff_off)
235 #define report_error(n) sp_report_error(n)
236
237 #if INCL_MULTIDEV
238
239 #define set_bitmap_device(bfuncs,size) sp_set_bitmap_device(bfuncs,size)
240 #define set_outline_device(ofuncs,size) sp_set_outline_device(ofuncs,size)
241
242 #define open_bitmap(x_set_width, y_set_width, xmin, xmax, ymin, ymax) (*sp_globals.bitmap_device.p_open_bitmap)(x_set_width, y_set_width, xmin, xmax, ymin, ymax)
243 #define set_bitmap_bits(y, xbit1, xbit2) (*sp_globals.bitmap_device.p_set_bits)(y, xbit1, xbit2)
244 #define close_bitmap() (*sp_globals.bitmap_device.p_close_bitmap)()
245
246 #define open_outline(x_set_width, y_set_width, xmin, xmax, ymin, ymax) (*sp_globals.outline_device.p_open_outline)(x_set_width, y_set_width, xmin, xmax, ymin, ymax)
247 #define start_new_char() (*sp_globals.outline_device.p_start_char)()
248 #define start_contour(x,y,outside) (*sp_globals.outline_device.p_start_contour)(x,y,outside)
249 #define curve_to(x1,y1,x2,y2,x3,y3) (*sp_globals.outline_device.p_curve)(x1,y1,x2,y2,x3,y3)
250 #define line_to(x,y) (*sp_globals.outline_device.p_line)(x,y)
251 #define close_contour() (*sp_globals.outline_device.p_close_contour)()
252 #define close_outline() (*sp_globals.outline_device.p_close_outline)()
253
254 #else
255
256 #define open_bitmap(x_set_width, y_set_width, xmin, xmax, ymin, ymax) sp_open_bitmap(x_set_width, y_set_width, xmin, xmax, ymin, ymax)
257 #define set_bitmap_bits(y, xbit1, xbit2) sp_set_bitmap_bits(y, xbit1, xbit2)
258 #define close_bitmap() sp_close_bitmap()
259
260 #define open_outline(x_set_width, y_set_width, xmin, xmax, ymin, ymax) sp_open_outline(x_set_width, y_set_width, xmin, xmax, ymin, ymax)
261 #define start_new_char() sp_start_new_char()
262 #define start_contour(x,y,outside) sp_start_contour(x,y,outside)
263 #define curve_to(x1,y1,x2,y2,x3,y3) sp_curve_to(x1,y1,x2,y2,x3,y3)
264 #define line_to(x,y) sp_line_to(x,y)
265 #define close_contour() sp_close_contour()
266 #define close_outline() sp_close_outline()
267
268 #endif
269
270 #else
271
272 #define GDECL SPEEDO_GLOBALS* sp_global_ptr;
273
274 #define get_char_id(char_index) sp_get_char_id(sp_global_ptr,char_index)
275 #define get_char_width(char_index) sp_get_char_width(sp_global_ptr,char_index)
276 #define get_track_kern(track,point_size) sp_get_track_kern(sp_global_ptr,track,point_size)
277 #define get_pair_kern(char_index1,char_index2) sp_get_pair_kern(sp_global_ptr,char_index1,char_index2)
278 #define get_char_bbox(char_index,bbox) sp_get_char_bbox(sp_global_ptr,char_index,bbox)
279 #define make_char(char_index) sp_make_char(sp_global_ptr,char_index)
280 #if INCL_ISW
281 #define compute_isw_scale() sp_compute_isw_scale(sp_global_ptr)
282 #define do_make_char(char_index) sp_do_make_char(sp_global_ptr,char_index)
283 #define make_char_isw(char_index,imported_width) sp_make_char_isw(sp_global_ptr,char_index,imported_width)
284 #define reset_xmax(xmax) sp_reset_xmax(sp_global_ptr,xmax)
285 #endif
286 #if INCL_ISW || INCL_SQUEEZING
287 #define preview_bounding_box(pointer,format) sp_preview_bounding_box(sp_global_ptr,pointer,format)
288 #endif
289 #define make_simp_char(pointer,format) sp_make_simp_char(sp_global_ptr,pointer,format)
290 #define make_comp_char(pointer) sp_make_comp_char(sp_global_ptr,pointer)
291 #define get_char_org(char_index,top_level) sp_get_char_org(sp_global_ptr,char_index,top_level)
292 #define get_posn_arg(ppointer,format) sp_get_posn_arg(sp_global_ptr,ppointer,format)
293 #define get_scale_arg(ppointer,format) sp_get_scale_arg(sp_global_ptr,ppointer,format)
294 #define read_bbox(ppointer,pPmin,pPmax,set_flag) sp_read_bbox(sp_global_ptr,ppointer,pPmin,pPmax,set_flag)
295 #define proc_outl_data(pointer) sp_proc_outl_data(sp_global_ptr,pointer)
296 #define split_curve(P1,P2,P3,depth) sp_split_curve(sp_global_ptr,P1,P2,P3,depth)
297 #define get_args(ppointer,format,pP) sp_get_args(sp_global_ptr,ppointer,format,pP)
298
299 #define init_black(specsarg) sp_init_black(sp_global_ptr,specsarg)
300 #define begin_char_black(Psw,Pmin,Pmax) sp_begin_char_black(sp_global_ptr,Psw,Pmin,Pmax)
301 #define begin_contour_black(P1,outside) sp_begin_contour_black(sp_global_ptr,P1,outside)
302 #define line_black(P1) sp_line_black(sp_global_ptr,P1)
303 #define end_char_black() sp_end_char_black(sp_global_ptr)
304 #define add_intercept_black(y,x) sp_add_intercept_black(sp_global_ptr,y,x)
305 #define proc_intercepts_black() sp_proc_intercepts_black(sp_global_ptr)
306
307 #define init_screen(specsarg) sp_init_screen(sp_global_ptr,specsarg)
308 #define begin_char_screen(Psw,Pmin,Pmax) sp_begin_char_screen(sp_global_ptr,Psw,Pmin,Pmax)
309 #define begin_contour_screen(P1,outside) sp_begin_contour_screen(sp_global_ptr,P1,outside)
310 #define curve_screen(P1,P2,P3,depth) sp_curve_screen(sp_global_ptr,P1,P2,P3,depth)
311 #define scan_curve_screen(X0,Y0,X1,Y1,X2,Y2,X3,Y3) sp_scan_curve_screen(sp_global_ptr,X0,Y0,X1,Y1,X2,Y2,X3,Y3) 
312 #define vert_line_screen(x,y1,y2) sp_vert_line_screen(sp_global_ptr,x,y1,y2)
313 #define line_screen(P1) sp_line_screen(sp_global_ptr,P1)
314 #define end_char_screen() sp_end_char_screen(sp_global_ptr)
315 #define end_contour_screen() sp_end_contour_screen(sp_global_ptr)
316 #define add_intercept_screen(y,x) sp_add_intercept_screen(sp_global_ptr,y,x)
317 #define proc_intercepts_screen() sp_proc_intercepts_screen(sp_global_ptr)
318
319 #define init_outline(specsarg) sp_init_outline(sp_global_ptr,specsarg)
320 #define begin_char_outline(Psw,Pmin,Pmax) sp_begin_char_outline(sp_global_ptr,Psw,Pmin,Pmax)
321 #define begin_sub_char_outline(Psw,Pmin,Pmax) sp_begin_sub_char_outline(sp_global_ptr,Psw,Pmin,Pmax)
322 #define begin_contour_outline(P1,outside) sp_begin_contour_outline(sp_global_ptr,P1,outside)
323 #define curve_outline(P1,P2,P3,depth) sp_curve_outline(sp_global_ptr,P1,P2,P3,depth)
324 #define line_outline(P1) sp_line_outline(sp_global_ptr,P1)
325 #define end_contour_outline() sp_end_contour_outline(sp_global_ptr)
326 #define end_sub_char_outline() sp_end_sub_char_outline(sp_global_ptr)
327 #define end_char_outline() sp_end_char_outline(sp_global_ptr)
328
329 #define init_2d(specsarg) sp_init_2d(sp_global_ptr,specsarg)
330 #define begin_char_2d(Psw, Pmin, Pmax) sp_begin_char_2d(sp_global_ptr,Psw, Pmin, Pmax)
331 #define begin_contour_2d(P1, outside) sp_begin_contour_2d(sp_global_ptr,P1, outside)
332 #define line_2d(P1) sp_line_2d(sp_global_ptr,P1)
333 #define end_char_2d() sp_end_char_2d(sp_global_ptr)
334 #define add_intercept_2d(y, x) sp_add_intercept_2d(sp_global_ptr,y, x)
335 #define proc_intercepts_2d() sp_proc_intercepts_2d(sp_global_ptr)
336 #define draw_vector_to_2d(x0, y0, x1, y1, band) sp_draw_vector_to_2d(sp_global_ptr,x0, y0, x1, y1, band)
337
338 #define init_char_out(Psw,Pmin,Pmax) sp_init_char_out(sp_global_ptr,Psw,Pmin,Pmax)
339 #define begin_sub_char_out(Psw,Pmin,Pmax) sp_begin_sub_char_out(sp_global_ptr,Psw,Pmin,Pmax)
340 #define curve_out(P1,P2,P3,depth) sp_curve_out(sp_global_ptr,P1,P2,P3,depth)
341 #define end_contour_out() sp_end_contour_out(sp_global_ptr)
342 #define end_sub_char_out() sp_end_sub_char_out(sp_global_ptr)
343 #define init_intercepts_out() sp_init_intercepts_out(sp_global_ptr)
344 #define restart_intercepts_out() sp_restart_intercepts_out(sp_global_ptr)
345 #define set_first_band_out(Pmin,Pmax) sp_set_first_band_out(sp_global_ptr,Pmin,Pmax)
346 #define reduce_band_size_out() sp_reduce_band_size_out(sp_global_ptr)
347 #define next_band_out() sp_next_band_out(sp_global_ptr)
348
349 #define init_userout(specsarg) sp_init_userout(sp_global_ptr,specsarg)
350
351 #define reset() sp_reset(sp_global_ptr)
352 #define set_key(key) sp_set_key(sp_global_ptr,key)
353 #define get_cust_no(font_buff) sp_get_cust_no(sp_global_ptr,font_buff)
354 #define set_specs(specsarg) sp_set_specs(sp_global_ptr,specsarg)
355 #define setup_consts(xmin,xmax,ymin,ymax) sp_setup_consts(sp_global_ptr,xmin,xmax,ymin,ymax)
356 #define setup_tcb(ptcb) sp_setup_tcb(sp_global_ptr,ptcb)
357 #define setup_mult(input_mult) sp_setup_mult(sp_global_ptr,input_mult)
358 #define setup_offset(input_offset) sp_setup_offset(sp_global_ptr,input_offset)
359 #define type_tcb(ptcb) sp_type_tcb(sp_global_ptr,ptcb)
360 #define read_long(pointer) sp_read_long(sp_global_ptr,pointer)
361 #define read_word_u(pointer) sp_read_word_u(sp_global_ptr,pointer)
362 #define init_tcb() sp_init_tcb(sp_global_ptr)
363 #define scale_tcb(ptcb,x_pos,y_pos,x_scale,y_scale) sp_scale_tcb(sp_global_ptr,ptcb,x_pos,y_pos,x_scale,y_scale)
364 #define plaid_tcb(ppointer,format) sp_plaid_tcb(sp_global_ptr,ppointer,format)
365 #define skip_orus(ppointer,short_form,no_ctrl_zones) sp_skip_orus(sp_global_ptr,ppointer,short_form,no_ctrl_zones)
366 #define skip_interpolation_table(ppointer,format) sp_skip_interpolation_table(sp_global_ptr,ppointer,format)
367 #define skip_control_zone(ppointer,format) sp_skip_control_zone(sp_global_ptr,ppointer,format)
368 #define constr_update() sp_constr_update(sp_global_ptr)
369 #define read_oru_table(ppointer) sp_read_oru_table(sp_global_ptr,ppointer)
370 #define calculate_x_pix(start_edge,end_edge,constr_nr,x_scale,x_offset,ppo,setwidth_pix) sp_calculate_x_pix(sp_global_ptr,start_edge,end_edge,constr_nr,x_scale,x_offset,ppo,setwidth_pix)
371 #define calculate_y_pix(start_edge,end_edge,constr_nr,top_scale,bottom_scale,ppo,emtop_pix,embot_pix) sp_calculate_y_pix(sp_global_ptr,start_edge,end_edge,constr_nr,top_scale,bottom_scale,ppo,emtop_pix,embot_pix)
372 #define calculate_x_scale(x_factor,x_offset,no_x_ctrl_zones) sp_calculate_x_scale(sp_global_ptr,x_factor,x_offset,no_x_ctrl_zones)
373 #define calculate_y_scale(top_scale,bottom_scale,first_y_zone,no_Y_ctrl_zones) sp_calculate_y_scale(sp_global_ptr,top_scale,bottom_scale,first_y_zone,no_Y_ctrl_zones) 
374 #define setup_pix_table(ppointer,short_form,no_X_ctrl_zones,no_Y_ctrl_zones) sp_setup_pix_table(sp_global_ptr,ppointer,short_form,no_X_ctrl_zones,no_Y_ctrl_zones)
375 #define setup_int_table(ppointer,no_X_int_zones, no_Y_int_zones) sp_setup_int_table(sp_global_ptr,ppointer,no_X_int_zones, no_Y_int_zones)
376
377 #define fn_init_out(specsarg) (*sp_globals.init_out)(sp_global_ptr,specsarg)  
378 #define fn_begin_char(Psw,Pmin,Pmax) (*sp_globals.begin_char)(sp_global_ptr,Psw,Pmin,Pmax)
379 #define fn_begin_sub_char(Psw,Pmin,Pmax) (*sp_globals.begin_sub_char)(sp_global_ptr,Psw,Pmin,Pmax)
380 #define fn_end_sub_char() (*sp_globals.end_sub_char)(sp_global_ptr)
381 #define fn_end_char() (*sp_globals.end_char)(sp_global_ptr)
382 #define fn_line(P1) (*sp_globals.line)(sp_global_ptr,P1)
383 #define fn_end_contour() (*sp_globals.end_contour)(sp_global_ptr)
384 #define fn_begin_contour(P0,fmt) (*sp_globals.begin_contour)(sp_global_ptr,P0,fmt)
385 #define fn_curve(P1,P2,P3,depth) (*sp_globals.curve)(sp_global_ptr,P1,P2,P3,depth)
386
387
388 #define load_char_data(offset, no_bytes, buff_off) sp_load_char_data(sp_global_ptr, offset, no_bytes, buff_off)
389 #define report_error(n) sp_report_error(sp_global_ptr, n)
390
391 #if INCL_MULTIDEV
392
393 #define set_bitmap_device(bfuncs,size) sp_set_bitmap_device(sp_global_ptr,bfuncs,size)
394 #define set_outline_device(ofuncs,size) sp_set_outline_device(sp_global_ptr,ofuncs,size)
395
396 #define open_bitmap(x_set_width, y_set_width, xmin, xmax, ymin, ymax)(*sp_globals.bitmap_device.p_open_bitmap)(sp_global_ptr,x_set_width, y_set_width, xmin, xmax, ymin, ymax)
397 #define set_bitmap_bits(y, xbit1, xbit2)(*sp_globals.bitmap_device.p_set_bits)(sp_global_ptr,y, xbit1, xbit2)
398 #define close_bitmap()(*sp_globals.bitmap_device.p_close_bitmap)(sp_global_ptr)
399
400 #define open_outline(x_set_width, y_set_width, xmin, xmax, ymin, ymax)(*sp_globals.outline_device.p_open_outline)(sp_global_ptr,x_set_width, y_set_width, xmin, xmax, ymin, ymax)
401 #define start_new_char()(*sp_globals.outline_device.p_start_char)(sp_global_ptr)
402 #define start_contour(x,y,outside)(*sp_globals.outline_device.p_start_contour)(sp_global_ptr,x,y,outside)
403 #define curve_to(x1,y1,x2,y2,x3,y3)(*sp_globals.outline_device.p_curve)(sp_global_ptr,x1,y1,x2,y2,x3,y3)
404 #define line_to(x,y)(*sp_globals.outline_device.p_line)(sp_global_ptr,x,y)
405 #define close_contour()(*sp_globals.outline_device.p_close_contour)(sp_global_ptr)
406 #define close_outline()(*sp_globals.outline_device.p_close_outline)(sp_global_ptr)
407
408 #else
409
410 #define open_bitmap(x_set_width, y_set_width, xmin, xmax, ymin, ymax) sp_open_bitmap(sp_global_ptr, x_set_width, y_set_width, xmin, xmax, ymin, ymax)
411 #define set_bitmap_bits(y, xbit1, xbit2) sp_set_bitmap_bits(sp_global_ptr, y, xbit1, xbit2)
412 #define close_bitmap() sp_close_bitmap(sp_global_ptr)
413
414 #define open_outline(x_set_width, y_set_width, xmin, xmax, ymin, ymax) sp_open_outline(sp_global_ptr, x_set_width, y_set_width, xmin, xmax, ymin, ymax)
415 #define start_new_char() sp_start_new_char(sp_global_ptr )
416 #define start_contour(x,y,outside) sp_start_contour(sp_global_ptr, x,y,outside)
417 #define curve_to(x1,y1,x2,y2,x3,y3) sp_curve_to(sp_global_ptr, x1,y1,x2,y2,x3,y3)
418 #define line_to(x,y) sp_line_to(sp_global_ptr, x,y)
419 #define close_contour() sp_close_contour(sp_global_ptr)
420 #define close_outline() sp_close_outline(sp_global_ptr)
421
422 #endif
423 #endif
424
425