]> git.sesse.net Git - rdpsrv/blob - Xserver/lib/font/Speedo/speedo.h
Support RDP5 logon packets.
[rdpsrv] / Xserver / lib / font / Speedo / speedo.h
1 /* $XConsortium: speedo.h,v 1.7 95/06/08 23:20:39 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 #ifndef _SPEEDO_H_
26 #define _SPEEDO_H_
27
28 #include <X11/Xmd.h>
29
30 /***************************** S P E E D O . H *******************************
31  ****************************************************************************/
32
33 /*****  USER OPTIONS OVERRIDE DEFAULTS ******/
34 #include "useropt.h"
35
36 /*****  CONFIGURATION DEFINITIONS *****/
37
38 #ifndef INCL_CLIPPING
39 #define INCL_CLIPPING 0         /* 0 indicates CLIPPING code is not compiled in*/
40 #endif
41
42 #ifndef INCL_SQUEEZING
43 #define INCL_SQUEEZING 0                /* 0 indicates SQUEEZE code is not compiled in*/
44 #endif
45
46 #ifndef INCL_EXT
47 #define  INCL_EXT       1          /* 1 to include extended font support */
48 #endif                             /* 0 to omit extended font support */
49
50 #ifndef INCL_RULES
51 #define  INCL_RULES     1          /* 1 to include intelligent scaling support */
52 #endif                             /* 0 to omit intelligent scaling support */
53
54 #ifndef INCL_BLACK                                                    
55 #define  INCL_BLACK     1          /* 1 to include blackwriter output support */
56 #endif                             /* 0 to omit output mode 0 support */
57
58 #ifndef INCL_SCREEN
59 #define  INCL_SCREEN     0          /* 1 to include screen writeroutput support */
60 #endif                             /* 0 to omit support */
61
62 #ifndef INCL_OUTLINE
63 #define  INCL_OUTLINE     0          /* 1 to include outline output support */
64 #endif                             /* 0 to omit output mode 2 support */
65
66 #ifndef INCL_2D
67 #define  INCL_2D          0          /* 1 to include 2d blackwriter output support */
68 #endif                             /* 0 to omit output mode 3 support */
69
70 #ifndef INCL_USEROUT
71 #define INCL_USEROUT      0          /* 1 to include user defined output module support */
72 #endif                               /* 0 to omit user defined output module support */
73
74 #ifndef INCL_LCD
75 #define  INCL_LCD       1          /* 1 to include load char data support*/
76 #endif                             /* 0 to omit load char data support */
77 #ifndef INCL_ISW
78 #define  INCL_ISW       0          /* 1 to include imported width support */
79 #endif                             /* 0 to omit imported width support */
80
81 #ifndef INCL_METRICS
82 #define  INCL_METRICS   1          /* 1 to include metrics support */
83 #endif                             /* 0 to omit metrics support */
84
85 #ifndef INCL_KEYS
86 #define  INCL_KEYS      0          /* 1 to include multi key support */
87 #endif                             /* 0 to omit multi key support */
88
89 #ifndef INCL_MULTIDEV
90 #define  INCL_MULTIDEV  0          /* 1 to include multiple output device support */
91 #endif                             /* 0 to omit multi device support */
92
93 #ifndef SHORT_LISTS
94 #define SHORT_LISTS 1                  /* 1 to allocate small intercept lists */
95 #endif
96
97 #ifndef PROTOS_AVAIL                /* 1 to use function prototyping */
98 #define PROTOS_AVAIL 0                          /* 0 to suppress it */
99 #endif
100
101 #ifndef FONTFAR                                         /* if Intel mixed memory model implementation */
102 #define FONTFAR                                         /* pointer type modifier for font buffer */
103 #endif
104
105 #ifndef STACKFAR                                        /* if Intel mixed memory model implementation */
106 #define STACKFAR                                        /* pointer type modifier for font buffer */
107 #endif
108
109 #ifndef GLOBALFAR
110 #define GLOBALFAR
111 #endif
112  
113 #define MODE_BLACK 0
114 #define MODE_SCREEN MODE_BLACK + INCL_BLACK
115 #define MODE_OUTLINE MODE_SCREEN + INCL_SCREEN
116 #define MODE_2D MODE_OUTLINE + INCL_OUTLINE
117
118 #ifdef DYNAMIC_ALLOC
119 #if DYNAMIC_ALLOC 
120 #define STATIC_ALLOC 0
121 #endif
122 #endif
123
124 #ifdef REENTRANT_ALLOC
125 #if REENTRANT_ALLOC 
126 #define STATIC_ALLOC 0
127 #endif
128 #endif
129
130 #ifndef STATIC_ALLOC
131 #define STATIC_ALLOC 1
132 #endif
133
134 #ifndef DYNAMIC_ALLOC
135 #define DYNAMIC_ALLOC 0
136 #endif
137
138 #ifndef REENTRANT_ALLOC
139 #define REENTRANT_ALLOC 0
140 #endif
141
142 /*****  TYPE  DEFINITIONS *****/
143
144 #ifndef STDEF
145 #ifndef SPD_BMAP
146
147 typedef INT8 fix7;
148
149 typedef   double   real;
150
151 typedef   CARD8    ufix8;
152 #ifndef VFONT
153 typedef   CARD8    boolean;
154 #endif
155 #endif
156
157 typedef   INT16    fix15;
158
159 typedef   CARD16   ufix16;
160
161 typedef   INT32    fix31;
162
163 typedef   CARD32   ufix32;
164 #endif
165
166 /***** GENERAL CONSTANTS *****/
167
168 #ifndef FALSE
169 #define  FALSE     0
170 #define  TRUE      1
171 #endif
172
173 #ifndef NULL
174 #define NULL       0
175 #endif
176
177 #define  FUNCTION
178
179 #define  BIT0           0x01
180 #define  BIT1           0x02
181 #define  BIT2           0x04
182 #define  BIT3           0x08
183 #define  BIT4           0x10
184 #define  BIT5           0x20
185 #define  BIT6           0x40
186 #define  BIT7           0x80
187
188 #if INCL_EXT                       /* Extended fonts supported? */
189
190 #define  MAX_CONSTR     750       /* Max constraints (incl 4 dummies) */
191 #define  MAX_CTRL_ZONES  256       /* Max number of controlled orus */
192 #define  MAX_INT_ZONES   256       /* Max number of interpolation zones */
193
194 #else                              /* Compact fonts only supported */
195
196 #define  MAX_CONSTR      512       /* Max constraints (incl 4 dummies) */
197 #define  MAX_CTRL_ZONES   64       /* Max number of controlled orus */
198 #define  MAX_INT_ZONES    64       /* Max number of interpolation zones */
199
200 #endif
201
202 #define  SCALE_SHIFT   12   /* Binary point positiion for scale values */
203 #define  SCALE_RND   2048   /* Rounding bit for scaling transformation */
204 #define  ONE_SCALE   4096   /* Unity scale value */
205     
206 #ifdef INCL_SCREEN   /* constants used by Screenwriter module */
207 #define LEFT_INT 1   /* left intercept */
208 #define END_INT 2    /* last intercept */
209 #define FRACTION 0xFC  /* fractional portion of intercept type list */
210 #endif
211
212 #if INCL_SQUEEZING || INCL_CLIPPING          /* constants used by SQUEEZEing code */
213 #define EM_TOP 764
214 #define EM_BOT -236
215 #endif
216
217 /*****  STRUCTURE DEFINITIONS *****/
218 #if PROTOS_AVAIL
219
220 #if REENTRANT_ALLOC
221 #define PROTO_DECL1 struct speedo_global_data GLOBALFAR *sp_global_ptr
222 #define PROTO_DECL2 PROTO_DECL1 ,
223 #else
224 #define PROTO_DECL1 void
225 #define PROTO_DECL2
226 #endif
227 #endif
228
229 typedef
230 struct buff_tag
231     {
232     ufix8 FONTFAR *org;                   /* Pointer to start of buffer */
233     ufix32  no_bytes;              /* Size of buffer in bytes */
234     } 
235 buff_t;                            /* Buffer descriptor */
236
237 typedef  struct constr_tag
238     {
239     ufix8 FONTFAR *org;                   /* Pointer to first byte in constr data  */
240     ufix16  font_id;               /* Font id for calculated data           */
241     fix15   xppo;                  /* X pixels per oru for calculated data  */
242     fix15   yppo;                  /* Y pixels per oru for calculated data  */
243     boolean font_id_valid;         /* TRUE if font id valid                 */
244     boolean data_valid;            /* TRUE if calculated data valid         */
245     boolean active;                /* TRUE if constraints enabled           */
246     }                  
247 constr_t;                          /* Constraint data state                 */
248
249 typedef  struct kern_tag
250     {
251     ufix8 FONTFAR *tkorg;                 /* First byte of track kerning data      */
252     ufix8 FONTFAR *pkorg;                 /* First byte of pair kerning data       */
253     fix15   no_tracks;             /* Number of kerning tracks              */
254     fix15   no_pairs;              /* Number of kerning pairs               */
255     }                  
256 kern_t;                            /* Kerning control block                 */
257
258 typedef struct specs_tag
259     {
260     buff_t STACKFAR *pfont;                 /* Pointer to font data                  */
261     fix31   xxmult;                /* Coeff of X orus to compute X pix      */
262     fix31   xymult;                /* Coeff of Y orus to compute X pix      */
263     fix31   xoffset;               /* Constant to compute X pix             */
264     fix31   yxmult;                /* Coeff of X orus to compute Y pix      */
265     fix31   yymult;                /* Coeff of Y orus to compute Y pix      */
266     fix31   yoffset;               /* Constant to compute Y pix             */
267     ufix32  flags;                 /* Mode flags:                           */
268                                    /*   Bit  0 - 2: Output module selector: */
269                                    /*   Bit  3: Send curves to output module*/
270                                    /*   Bit  4: Use linear scaling if set   */
271                                    /*   Bit  5: Inhibit constraint table    */
272                                    /*   Bit  6: Import set width if set     */
273                                    /*   Bit  7:   not used                  */
274                                    /*   Bit  8: Squeeze left if set         */
275                                    /*   Bit  9: Squeeze right if set        */
276                                    /*   Bit 10: Squeeze top if set          */
277                                    /*   Bit 11: Squeeze bottom if set       */
278                                    /*   Bit 12: Clip left if set            */
279                                    /*   Bit 13: Clip right if set           */
280                                    /*   Bit 14: Clip top if set             */
281                                    /*   Bit 15: Clip bottom if set          */
282                                    /*   Bits 16-31   not used               */
283 #ifdef __STDC__
284     void *out_info;                /* information for output module         */
285 #else
286     char *out_info;
287 #endif
288     }
289 specs_t;                           /* Specs structure for fw_set_specs      */
290
291 typedef struct tcb_tag
292     {
293     fix15   xxmult;                /* Linear coeff of Xorus to compute Xpix */
294     fix15   xymult;                /* Linear coeff of Yorus to compute Xpix */
295     fix31   xoffset;               /* Linear constant to compute Xpix       */
296     fix15   yxmult;                /* Linear coeff of Xorus to compute Ypix */
297     fix15   yymult;                /* Linear coeff of Yorus to compute Ypix */
298     fix31   yoffset;               /* Linear constant to compute Ypix       */
299     fix15   xppo;                  /* Pixels per oru in X dimension of char */
300     fix15   yppo;                  /* Pixels per oru in Y dimension of char */
301     fix15   xpos;                  /* Origin in X dimension of character    */
302     fix15   ypos;                  /* Origin in Y dimension of character    */
303     ufix16  xtype;                 /* Transformation type for X oru coords  */
304     ufix16  ytype;                 /* Transformation type for Y oru coords  */
305     ufix16  xmode;                 /* Transformation mode for X oru coords  */
306     ufix16  ymode;                 /* Transformation mode for Y oru coords  */
307         fix15  mirror;                /* Transformation creates mirror image   */
308     }
309 tcb_t;                             /* Transformation control block          */
310
311 typedef struct point_tag
312     {
313     fix15   x;                     /* X coord of point (shifted pixels)     */
314     fix15   y;                     /* Y coord of point (shifted pixels)     */
315     }
316 point_t;                           /* Point in device space                 */
317
318 typedef struct band_tag
319     {
320     fix15   band_max;
321     fix15   band_min;
322     fix15   band_array_offset;
323     fix15   band_floor;
324     fix15   band_ceiling;
325     } band_t;
326
327 typedef struct bbox_tag
328     {
329     fix31   xmin;
330     fix31   xmax;
331     fix31   ymin;
332     fix31   ymax;
333     } bbox_t;
334
335 #if SHORT_LISTS 
336 #define  MAX_INTERCEPTS  256      /* Max storage for intercepts */
337 typedef  ufix8   cdr_t;           /* 8 bit links in intercept chains */
338 #else
339 #define  MAX_INTERCEPTS 1000      /* Max storage for intercepts */
340 typedef  ufix16   cdr_t;          /* 16 bit links in intercept chains */
341 #endif
342
343 #if REENTRANT_ALLOC
344
345 typedef struct intercepts_tag
346     {
347         fix15 car[MAX_INTERCEPTS];
348         fix15 cdr[MAX_INTERCEPTS];
349 #if INCL_SCREEN
350         ufix8 inttype[MAX_INTERCEPTS];
351         ufix8 leftedge;
352         ufix16 fracpix;
353 #endif
354         } intercepts_t;
355
356 typedef struct plaid_tag
357         {
358         fix15    orus[MAX_CTRL_ZONES];   /* Controlled coordinate table (orus) */
359 #if INCL_RULES
360         fix15    pix[MAX_CTRL_ZONES];    /* Controlled coordinate table (sub-pixels) */
361         fix15    mult[MAX_INT_ZONES];    /* Interpolation multiplier table */
362         fix31    offset[MAX_INT_ZONES];  /* Interpolation offset table */
363 #endif
364         } plaid_t;
365 #endif
366
367 #if INCL_MULTIDEV
368 #if PROTOS_AVAIL
369 typedef struct bitmap_tag 
370         {
371         void (*p_open_bitmap)(PROTO_DECL2 fix31 x_set_width, fix31 y_set_width, fix31 xorg, fix31 yorg, fix15 xsize,fix15 ysize);
372         void (*p_set_bits)(PROTO_DECL2 fix15 y, fix15 xbit1, fix15 xbit2);
373         void (*p_close_bitmap)(PROTO_DECL1);
374         } bitmap_t;
375
376 typedef struct outline_tag 
377         {
378         void (*p_open_outline)(PROTO_DECL2 fix31 x_set_width, fix31 y_set_width, fix31 xmin, fix31 xmax, fix31 ymin,fix31 ymax);
379         void (*p_start_char)(PROTO_DECL1);
380         void (*p_start_contour)(PROTO_DECL2 fix31 x,fix31 y,boolean outside);
381         void (*p_curve)(PROTO_DECL2 fix31 x1, fix31 y1, fix31 x2, fix31 y2, fix31 x3, fix31 y3);
382         void (*p_line)(PROTO_DECL2 fix31 x, fix31 y);
383         void (*p_close_contour)(PROTO_DECL1);
384         void (*p_close_outline)(PROTO_DECL1);
385         } outline_t;
386 #else
387 typedef struct bitmap_tag 
388         {
389         void (*p_open_bitmap)();
390         void (*p_set_bits)();
391         void (*p_close_bitmap)();
392         } bitmap_t;
393
394 typedef struct outline_tag 
395         {
396         void (*p_open_outline)();
397         void (*p_start_char)();
398         void (*p_start_contour)();
399         void (*p_curve)();
400         void (*p_line)();
401         void (*p_close_contour)();
402         void (*p_close_outline)();
403         } outline_t;
404 #endif
405 #endif
406
407 /* ---------------------------------------------------*/
408 /****  MAIN GLOBAL DATA STRUCTURE, SPEEDO_GLOBALS *****/
409
410 typedef struct speedo_global_data 
411         {
412 /*  do_char.c data definitions */
413 #if INCL_METRICS                    /* Metrics functions supported? */
414          kern_t  kern;              /* Kerning control block */
415 #endif                                                               /* endif incl_metrics */
416          point_t   Psw;             /* End of escapement vector (1/65536 pixel units) */
417
418 #if INCL_LCD                        /* Dynamic load character data supported? */
419          fix15  cb_offset;          /* Offset to sub-char data in char buffer */
420 #endif                                                               /* endif incl_lcd */
421
422 /* do_trns.c data definitions */
423          point_t  P0;               /* Current point (sub-pixels) */
424          fix15    x_orus;           /* Current X argument (orus) */
425          fix15    y_orus;           /* Current Y argument (orus) */
426          fix15    x_pix;            /* Current X argument (sub-pixels) */
427          fix15    y_pix;            /* Current Y argument (sub-pixels) */
428          ufix8    x_int;            /* Current X interpolation zone */
429          ufix8    y_int;            /* Current Y interpolation zone */
430
431 #if INCL_MULTIDEV && INCL_OUTLINE
432      outline_t outline_device;
433      boolean   outline_device_set;
434 #endif
435
436 #if INCL_BLACK || INCL_SCREEN || INCL_2D
437 #if INCL_MULTIDEV
438      bitmap_t bitmap_device;
439      boolean  bitmap_device_set;
440 #endif
441      band_t   y_band;           /* Y current band(whole pixels) */
442
443          struct set_width_tag
444         {
445         fix31 x;
446         fix31 y;
447         } set_width; /* Character escapement vector */
448
449          boolean  first_pass;       /* TRUE during first pass thru outline data */
450          boolean  extents_running;  /* T if extent accumulation for each vector */
451          fix15    x0_spxl;          /* X coord of current point (sub pixels) */
452          fix15    y0_spxl;          /* Y coord of current point (sub pixels) */
453          fix15    y_pxl;            /* Y coord of current point (whole pixels) */
454 #if REENTRANT_ALLOC
455      intercepts_t STACKFAR *intercepts;
456 #else                                                                /* else if not reentrant */
457          fix15    car[MAX_INTERCEPTS]; /* Data field of intercept storage */
458          cdr_t    cdr[MAX_INTERCEPTS]; /* Link field of intercept storage */
459 #if INCL_SCREEN
460          ufix8    inttype[MAX_INTERCEPTS];
461          ufix8    leftedge;
462          ufix16   fracpix;
463 #endif                                                               /* endif incl_screen */
464 #endif                                                               /* endif reentrant */
465          fix15    bmap_xmin;        /* Min X value (sub-pixel units) */
466          fix15    bmap_xmax;        /* Max X value (sub-pixel units) */
467          fix15    bmap_ymin;        /* Min Y value (sub-pixel units) */
468          fix15    bmap_ymax;        /* Max Y value (sub-pixel units) */
469          fix15    no_y_lists;       /* Number of active intercept lists */
470          fix15    first_offset;     /* Index of first active list cell */
471          fix15    next_offset;      /* Index of next free list cell */
472          boolean  intercept_oflo;   /* TRUE if intercepts data lost */
473 #endif                                                               /* endif incl_black, incl_screen, incl_2d */
474
475 /* bounding box now used by all output modules, including outline */
476          fix15    xmin;             /* Min X value in whole character */
477          fix15    xmax;             /* Max X value in whole character */
478          fix15    ymin;             /* Min Y value in whole character */
479          fix15    ymax;             /* Max Y value in whole character */
480
481 #if INCL_2D
482          fix15    no_x_lists;       /* Number of active x intercept lists */
483          band_t   x_band;           /* X current band(whole pixels) */
484          boolean  x_scan_active;    /* X scan flag during scan conversion */
485 #endif
486
487 /* reset.c data definitions */
488          ufix16   key32;            /* Decryption keys 3,2 combined */
489          ufix8    key4;             /* Decryption key 4 */
490          ufix8    key6;             /* Decryption key 6 */
491          ufix8    key7;             /* Decryption key 7 */
492          ufix8    key8;             /* Decryption key 8 */
493
494 /* set_spcs.c data definitions */
495          buff_t   font;
496          buff_t GLOBALFAR *pfont; /* Pointer to font buffer structure */
497          fix31    font_buff_size; /* Number of bytes loaded in font buffer */
498          ufix8 FONTFAR *pchar_dir; /* Pointer to character directory */
499          fix15    first_char_idx; /* Index to first character in font */
500          fix15    no_chars_avail; /* Total characters in font layout */
501          fix15    orus_per_em;    /* Outline resolution */
502          fix15    metric_resolution; /* metric resolution for setwidths, kerning pairs
503                                                         (defaults to orus_per_em) */
504          tcb_t    tcb0;           /* Top level transformation control block */
505         
506          boolean  specs_valid;    /* TRUE if fw_set_specs() successful */
507         
508          fix15    depth_adj;      /* Curve splitting depth adjustment */
509          boolean  curves_out;     /* Allow curves to output module */
510          fix15    output_mode;    /* Output module selector */
511          fix15    thresh;         /* Scan conversion threshold (sub-pixels) */
512          boolean  normal;         /* TRUE if 0 obl and mult of 90 deg rot  */
513         
514          fix15    multshift;      /* Fixed point shift for multipliers */
515          fix15    pixshift;       /* Fixed point shift for sub-pixels */
516          fix15    poshift;        /* Left shift from pixel to output format */
517          fix15    mpshift;        /* Fixed point shift for mult to sub-pixels */
518          fix31    multrnd;        /* 0.5 in multiplier units */
519          fix15    pixrnd;         /* 0.5 in sub-pixel units */
520          fix31    mprnd;          /* 0.5 sub-pixels in multiplier units */
521          fix15    pixfix;         /* Mask to remove fractional pixels */
522          fix15    onepix;         /* 1.0 pixels in sub-pixel units */
523
524 #if PROTOS_AVAIL
525          boolean (*init_out)(PROTO_DECL2 specs_t GLOBALFAR *specsarg);
526          boolean (*begin_char)(PROTO_DECL2 point_t Psw,point_t Pmin,point_t Pmax); 
527          void    (*begin_sub_char)(PROTO_DECL2 point_t Psw,point_t Pmin,point_t Pmax);
528          void    (*begin_contour)(PROTO_DECL2 point_t P1,boolean outside); 
529          void    (*curve)(PROTO_DECL2 point_t P1, point_t P2, point_t P3, fix15 depth);  
530          void    (*line)(PROTO_DECL2 point_t P1);               
531          void    (*end_contour)(PROTO_DECL1); 
532          void    (*end_sub_char)(PROTO_DECL1);
533          boolean (*end_char)(PROTO_DECL1);    
534 #else                                                                /* if not protos */
535          boolean (*init_out)();
536          boolean (*begin_char)(); 
537          void    (*begin_sub_char)();
538          void    (*begin_contour)(); 
539          void    (*curve)();         
540          void    (*line)();               
541          void    (*end_contour)(); 
542          void    (*end_sub_char)();
543          boolean (*end_char)();
544 #endif                                                               /* end not protos */
545
546          specs_t GLOBALFAR *pspecs;    /* Pointer to specifications bundle */
547          specs_t specs;                /* copy specs onto stack */
548          ufix8 FONTFAR  *font_org;     /* Pointer to start of font data */
549          ufix8 FONTFAR  *hdr2_org;     /* Pointer to start of private header data */
550
551 /* set_trns.c data definitions */
552          tcb_t    tcb;                 /* Current transformation control block */
553          ufix8    Y_edge_org;          /* Index to first Y controlled coordinate */
554          ufix8    Y_int_org;           /* Index to first Y interpolation zone */
555          fix31    rnd_xmin;            /* rounded out value of xmin for int-char spac. fix */
556
557 #if REENTRANT_ALLOC
558          plaid_t STACKFAR  *plaid;
559 #else                                                                /* if not reentrant */
560          fix15    orus[MAX_CTRL_ZONES];   /* Controlled coordinate table (orus) */
561 #if INCL_RULES
562          fix15    pix[MAX_CTRL_ZONES];    /* Controlled coordinate table (sub-pixels) */
563          fix15    mult[MAX_INT_ZONES];    /* Interpolation multiplier table */
564          fix31    offset[MAX_INT_ZONES];  /* Interpolation offset table */
565 #endif                                                               /* endif incl_rules */
566 #endif                                                               /* endif not reentrant */
567
568          fix15    no_X_orus;              /* Number of X controlled coordinates */
569          fix15    no_Y_orus;              /* Number of Y controlled coordinates */
570          ufix16   Y_constr_org;           /* Origin of constraint table in font data */
571
572 #if INCL_RULES
573          constr_t constr;                 /* Constraint data state */
574          boolean  c_act[MAX_CONSTR];      /* TRUE if constraint currently active */
575          fix15    c_pix[MAX_CONSTR];      /* Size of constrained zone if active */
576 #endif                                                            
577 #if  INCL_ISW       
578          boolean import_setwidth_act;     /* boolean to indicate imported setwidth */
579          boolean isw_modified_constants;
580          ufix32 imported_width;           /* value of imported setwidth */      
581          fix15 isw_xmax;                  /* maximum oru value for constants*/
582 #endif
583 #if INCL_SQUEEZING || INCL_ISW
584          fix15 setwidth_orus;             /* setwidth value in orus */
585         /* bounding box in orus for squeezing */
586          fix15 bbox_xmin_orus;            /* X minimum in orus */
587          fix15 bbox_xmax_orus;            /* X maximum in orus */
588          fix15 bbox_ymin_orus;            /* Y minimum in orus */
589          fix15 bbox_ymax_orus;            /* Y maximum in orus */
590 #endif
591 #ifdef INCL_SQUEEZING
592          boolean squeezing_compound;       /* flag to indicate a compound character*/
593 #endif
594 #ifdef INCL_CLIPPING
595         fix31 clip_xmax;
596         fix31 clip_ymax;
597         fix31 clip_xmin;
598         fix31 clip_ymin;
599 #endif
600         } SPEEDO_GLOBALS;
601
602 /***********************************************************************************
603  *
604  *  Speedo global data structure allocation 
605  *
606  ***********************************************************************************/
607
608 #ifdef SET_SPCS
609 #define EXTERN 
610 #else
611 #define EXTERN extern
612 #endif
613 #if STATIC_ALLOC
614 EXTERN SPEEDO_GLOBALS GLOBALFAR sp_globals;
615 #define sp_intercepts sp_globals
616 #define sp_plaid sp_globals
617 #else
618 #if DYNAMIC_ALLOC
619 EXTERN SPEEDO_GLOBALS GLOBALFAR *sp_global_ptr;
620 #define sp_globals (*sp_global_ptr)
621 #define sp_intercepts (*sp_global_ptr)
622 #define sp_plaid (*sp_global_ptr)
623 #else
624 #if REENTRANT_ALLOC
625 #define sp_globals (*sp_global_ptr)
626 #define sp_intercepts (*(*sp_global_ptr).intercepts)
627 #define sp_plaid (*(*sp_global_ptr).plaid)
628 #endif
629 #endif
630 #endif
631 #ifdef EXTERN
632 #undef EXTERN
633 #endif
634
635
636 /***** PUBLIC FONT HEADER OFFSET CONSTANTS  *****/
637 #define  FH_FMVER    0      /* U   D4.0 CR LF NULL NULL  8 bytes            */
638 #define  FH_FNTSZ    8      /* U   Font size (bytes) 4 bytes                */
639 #define  FH_FBFSZ   12      /* U   Min font buffer size (bytes) 4 bytes     */
640 #define  FH_CBFSZ   16      /* U   Min char buffer size (bytes) 2 bytes     */
641 #define  FH_HEDSZ   18      /* U   Header size (bytes) 2 bytes              */
642 #define  FH_FNTID   20      /* U   Source Font ID  2 bytes                  */
643 #define  FH_SFVNR   22      /* U   Source Font Version Number  2 bytes      */
644 #define  FH_FNTNM   24      /* U   Source Font Name  70 bytes               */
645 #define  FH_MDATE   94      /* U   Manufacturing Date  10 bytes             */
646 #define  FH_LAYNM  104      /* U   Layout Name  70 bytes                    */
647 #define  FH_CPYRT  174      /* U   Copyright Notice  78 bytes               */
648 #define  FH_NCHRL  252      /* U   Number of Chars in Layout  2 bytes       */
649 #define  FH_NCHRF  254      /* U   Total Number of Chars in Font  2 bytes   */
650 #define  FH_FCHRF  256      /* U   Index of first char in Font  2 bytes     */
651 #define  FH_NKTKS  258      /* U   Number of kerning tracks in font 2 bytes */
652 #define  FH_NKPRS  260      /* U   Number of kerning pairs in font 2 bytes  */
653 #define  FH_FLAGS  262      /* U   Font flags 1 byte:                       */
654                             /*       Bit 0: Extended font                   */
655                             /*       Bit 1: not used                        */
656                             /*       Bit 2: not used                        */
657                             /*       Bit 3: not used                        */
658                             /*       Bit 4: not used                        */
659                             /*       Bit 5: not used                        */
660                             /*       Bit 6: not used                        */
661                             /*       Bit 7: not used                        */
662 #define  FH_CLFGS  263      /* U   Classification flags 1 byte:             */
663                             /*       Bit 0: Italic                          */
664                             /*       Bit 1: Monospace                       */
665                             /*       Bit 2: Serif                           */
666                             /*       Bit 3: Display                         */
667                             /*       Bit 4: not used                        */
668                             /*       Bit 5: not used                        */
669                             /*       Bit 6: not used                        */
670                             /*       Bit 7: not used                        */
671 #define  FH_FAMCL  264      /* U   Family Classification 1 byte:            */
672                             /*       0:  Don't care                         */
673                             /*       1:  Serif                              */
674                             /*       2:  Sans serif                         */
675                             /*       3:  Monospace                          */
676                             /*       4:  Script or calligraphic             */
677                             /*       5:  Decorative                         */
678                             /*       6-255: not used                        */
679 #define  FH_FRMCL  265      /* U   Font form Classification 1 byte:         */
680                             /*       Bits 0-3 (width type):                 */
681                             /*         0-3:   not used                      */
682                             /*         4:     Condensed                     */
683                             /*         5:     not used                      */
684                             /*         6:     Semi-condensed                */
685                             /*         7:     not used                      */
686                             /*         8:     Normal                        */
687                             /*         9:     not used                      */
688                             /*        10:     Semi-expanded                 */
689                             /*        11:     not used                      */
690                             /*        12:     Expanded                      */
691                             /*        13-15:  not used                      */
692                             /*       Bits 4-7 (Weight):                     */
693                             /*         0:   not used                        */
694                             /*         1:   Thin                            */
695                             /*         2:   Ultralight                      */
696                             /*         3:   Extralight                      */
697                             /*         4:   Light                           */
698                             /*         5:   Book                            */
699                             /*         6:   Normal                          */
700                             /*         7:   Medium                          */
701                             /*         8:   Semibold                        */
702                             /*         9:   Demibold                        */
703                             /*         10:  Bold                            */
704                             /*         11:  Extrabold                       */
705                             /*         12:  Ultrabold                       */
706                             /*         13:  Heavy                           */
707                             /*         14:  Black                           */
708                             /*         15-16: not used                      */
709 #define  FH_SFNTN  266      /* U   Short Font Name  32 bytes                */
710 #define  FH_SFACN  298      /* U   Short Face Name  16 bytes                */
711 #define  FH_FNTFM  314      /* U   Font form 14 bytes                       */
712 #define  FH_ITANG  328      /* U   Italic angle 2 bytes (1/256th deg)       */
713 #define  FH_ORUPM  330      /* U   Number of ORUs per em  2 bytes           */
714 #define  FH_WDWTH  332      /* U   Width of Wordspace  2 bytes              */
715 #define  FH_EMWTH  334      /* U   Width of Emspace  2 bytes                */
716 #define  FH_ENWTH  336      /* U   Width of Enspace  2 bytes                */
717 #define  FH_TNWTH  338      /* U   Width of Thinspace  2 bytes              */
718 #define  FH_FGWTH  340      /* U   Width of Figspace  2 bytes               */
719 #define  FH_FXMIN  342      /* U   Font-wide min X value  2 bytes           */
720 #define  FH_FYMIN  344      /* U   Font-wide min Y value  2 bytes           */
721 #define  FH_FXMAX  346      /* U   Font-wide max X value  2 bytes           */
722 #define  FH_FYMAX  348      /* U   Font-wide max Y value  2 bytes           */
723 #define  FH_ULPOS  350      /* U   Underline position 2 bytes               */
724 #define  FH_ULTHK  352      /* U   Underline thickness 2 bytes              */
725 #define  FH_SMCTR  354      /* U   Small caps transformation 6 bytes        */
726 #define  FH_DPSTR  360      /* U   Display sups transformation 6 bytes      */
727 #define  FH_FNSTR  366      /* U   Footnote sups transformation 6 bytes     */
728 #define  FH_ALSTR  372      /* U   Alpha sups transformation 6 bytes        */
729 #define  FH_CMITR  378      /* U   Chemical infs transformation 6 bytes     */
730 #define  FH_SNMTR  384      /* U   Small nums transformation 6 bytes        */
731 #define  FH_SDNTR  390      /* U   Small denoms transformation 6 bytes      */
732 #define  FH_MNMTR  396      /* U   Medium nums transformation 6 bytes       */
733 #define  FH_MDNTR  402      /* U   Medium denoms transformation 6 bytes     */
734 #define  FH_LNMTR  408      /* U   Large nums transformation 6 bytes        */
735 #define  FH_LDNTR  414      /* U   Large denoms transformation 6 bytes      */
736                             /*     Transformation data format:              */
737                             /*       Y position 2 bytes                     */
738                             /*       X scale 2 bytes (1/4096ths)            */
739                             /*       Y scale 2 bytes (1/4096ths)            */
740 #define  SIZE_FW FH_LDNTR + 6  /* size of nominal font header */
741 #define  EXP_FH_METRES SIZE_FW /* offset to expansion field metric resolution (optional) */
742
743
744
745 /***** MODE FLAGS CONSTANTS *****/
746 #define CURVES_OUT     0X0008  /* Output module accepts curves              */
747 #define BOGUS_MODE     0X0010  /* Linear scaling mode                       */
748 #define CONSTR_OFF     0X0020  /* Inhibit constraint table                  */
749 #define IMPORT_WIDTHS  0X0040  /* Imported width mode                       */
750 #define SQUEEZE_LEFT   0X0100  /* Squeeze left mode                         */
751 #define SQUEEZE_RIGHT  0X0200  /* Squeeze right mode                        */
752 #define SQUEEZE_TOP    0X0400  /* Squeeze top mode                          */
753 #define SQUEEZE_BOTTOM 0X0800  /* Squeeze bottom mode                       */
754 #define CLIP_LEFT      0X1000  /* Clip left mode                            */
755 #define CLIP_RIGHT     0X2000  /* Clip right mode                           */
756 #define CLIP_TOP       0X4000  /* Clip top mode                             */
757 #define CLIP_BOTTOM    0X8000  /* Clip bottom mode                          */
758
759 /***********************************************************************************
760  *
761  *  Speedo function declarations - use prototypes if available
762  *
763  ***********************************************************************************/
764
765 #if PROTOS_AVAIL
766 /*  do_char.c functions */
767 ufix16 sp_get_char_id(PROTO_DECL2 ufix16 char_index);
768 boolean sp_make_char(PROTO_DECL2 ufix16 char_index);
769 #if  INCL_ISW       
770 fix31 sp_compute_isw_scale(PROTO_DECL2);
771 static boolean sp_do_make_char(PROTO_DECL2 ufix16 char_index);
772 boolean sp_make_char_isw(PROTO_DECL2 ufix16 char_index, ufix32 imported_width);
773 static boolean sp_reset_xmax(PROTO_DECL2 fix31 xmax);
774 #endif
775 #if INCL_ISW || INCL_SQUEEZING
776 static void sp_preview_bounding_box(PROTO_DECL2 ufix8 FONTFAR  *pointer,ufix8    format);
777 #endif
778
779 #if INCL_METRICS                 /* Metrics functions supported? */
780 fix31 sp_get_char_width(PROTO_DECL2 ufix16 char_index);
781 fix15 sp_get_track_kern(PROTO_DECL2 fix15 track,fix15 point_size);
782 fix31 sp_get_pair_kern(PROTO_DECL2 ufix16 char_index1,ufix16 char_index2);
783 boolean sp_get_char_bbox(PROTO_DECL2 ufix16 char_index, bbox_t *bbox);
784 #endif
785
786 /* do_trns.c functions */
787 ufix8 FONTFAR *sp_read_bbox(PROTO_DECL2 ufix8 FONTFAR *pointer,point_t STACKFAR *pPmin,point_t STACKFAR *pPmax,boolean set_flag);
788 void sp_proc_outl_data(PROTO_DECL2 ufix8 FONTFAR *pointer);
789
790 /* out_blk.c functions */
791 #if INCL_BLACK
792 boolean sp_init_black(PROTO_DECL2 specs_t GLOBALFAR *specsarg);
793 boolean sp_begin_char_black(PROTO_DECL2 point_t Psw,point_t Pmin,point_t Pmax);
794 void sp_begin_contour_black(PROTO_DECL2 point_t P1,boolean outside);
795 void sp_line_black(PROTO_DECL2 point_t P1);
796 boolean sp_end_char_black(PROTO_DECL1);
797 #endif
798
799 /* out_scrn.c functions */
800 #if INCL_SCREEN
801 boolean sp_init_screen(PROTO_DECL2 specs_t GLOBALFAR *specsarg);
802 boolean sp_begin_char_screen(PROTO_DECL2 point_t Psw,point_t Pmin,point_t Pmax);
803 void sp_begin_contour_screen(PROTO_DECL2 point_t P1,boolean outside);
804 void sp_curve_screen(PROTO_DECL2 point_t P1,point_t P2,point_t P3, fix15 depth);
805 void sp_scan_curve_screen(PROTO_DECL2 fix31 X0,fix31 Y0,fix31 X1,fix31 Y1,fix31 X2,fix31 Y2,fix31 X3,fix31 Y3);
806 void sp_vert_line_screen(PROTO_DECL2   fix31 x, fix15 y1, fix15 y2);
807 void sp_line_screen(PROTO_DECL2 point_t P1);
808 void sp_end_contour_screen(PROTO_DECL1);
809 boolean sp_end_char_screen(PROTO_DECL1);
810 #endif
811
812 /* out_outl.c functions */
813 #if INCL_OUTLINE
814 #if INCL_MULTIDEV
815 boolean sp_set_outline_device(PROTO_DECL2 outline_t *ofuncs, ufix16 size);
816 #endif
817
818
819 boolean sp_init_outline(PROTO_DECL2 specs_t GLOBALFAR *specsarg);
820 boolean sp_begin_char_outline(PROTO_DECL2 point_t Psw,point_t Pmin,point_t Pmax);
821 void sp_begin_sub_char_outline(PROTO_DECL2 point_t Psw,point_t Pmin,point_t Pmax);
822 void sp_begin_contour_outline(PROTO_DECL2 point_t P1,boolean outside);
823 void sp_curve_outline(PROTO_DECL2 point_t P1,point_t P2,point_t P3, fix15 depth);
824 void sp_line_outline(PROTO_DECL2 point_t P1);
825 void sp_end_contour_outline(PROTO_DECL1);
826 void sp_end_sub_char_outline(PROTO_DECL1);
827 boolean sp_end_char_outline(PROTO_DECL1);
828 #endif
829
830 /* out_bl2d.c functions */
831 #if INCL_2D
832 boolean sp_init_2d(PROTO_DECL2 specs_t GLOBALFAR *specsarg);
833 boolean sp_begin_char_2d(PROTO_DECL2 point_t Psw,point_t Pmin,point_t Pmax);
834 void sp_begin_contour_2d(PROTO_DECL2 point_t P1,boolean outside);
835 void sp_line_2d(PROTO_DECL2 point_t P1);
836 boolean sp_end_char_2d(PROTO_DECL1);
837 #endif
838
839 /* out_util.c functions */
840 #if INCL_BLACK || INCL_SCREEN || INCL_2D
841         
842 #if INCL_MULTIDEV
843 boolean sp_set_bitmap_device(PROTO_DECL2 bitmap_t *bfuncs, ufix16 size);
844 #endif
845
846 void sp_init_char_out(PROTO_DECL2 point_t Psw, point_t Pmin, point_t Pmax);
847 void sp_begin_sub_char_out(PROTO_DECL2 point_t Psw, point_t Pmin, point_t Pmax);
848 void sp_curve_out(PROTO_DECL2 point_t P1, point_t P2, point_t P3, fix15 depth);
849 void sp_end_contour_out(PROTO_DECL1);
850 void sp_end_sub_char_out(PROTO_DECL1);
851 void sp_init_intercepts_out(PROTO_DECL1);
852 void sp_restart_intercepts_out(PROTO_DECL1);
853 void sp_set_first_band_out(PROTO_DECL2 point_t Pmin, point_t Pmax);
854 void sp_reduce_band_size_out(PROTO_DECL1);
855 boolean sp_next_band_out(PROTO_DECL1);
856 #endif
857
858 #if INCL_USEROUT
859 boolean sp_init_userout(specs_t *specsarg);
860 #endif
861
862
863 /* reset.c functions */
864 void sp_reset(PROTO_DECL1);
865 #if INCL_KEYS
866 void sp_set_key(PROTO_DECL2 ufix8 key[]);
867 #endif
868 ufix16 sp_get_cust_no(PROTO_DECL2 buff_t font_buff);
869
870 /* set_spcs.c functions */
871 boolean sp_set_specs(PROTO_DECL2 specs_t STACKFAR *specsarg);
872 void sp_type_tcb(PROTO_DECL2 tcb_t GLOBALFAR *ptcb);
873
874 fix31 sp_read_long(PROTO_DECL2 ufix8 FONTFAR *pointer);
875 fix15 sp_read_word_u(PROTO_DECL2 ufix8 FONTFAR *pointer);
876
877 /* set_trns.c functions */
878 void sp_init_tcb(PROTO_DECL1);
879 void sp_scale_tcb(PROTO_DECL2 tcb_t GLOBALFAR *ptcb,fix15 x_pos,fix15 y_pos,fix15 x_scale,fix15 y_scale);
880 ufix8 FONTFAR *sp_plaid_tcb(PROTO_DECL2 ufix8 FONTFAR *pointer,ufix8 format);
881 ufix8 FONTFAR *sp_skip_interpolation_table(PROTO_DECL2 ufix8 FONTFAR *pointer, ufix8 format);
882 ufix8 FONTFAR *sp_skip_control_zone(PROTO_DECL2 ufix8 FONTFAR *pointer, ufix8 format);
883
884 ufix8 FONTFAR *sp_read_oru_table(PROTO_DECL2 ufix8 FONTFAR *pointer);
885 #if INCL_SQUEEZING || INCL_ISW
886 static void sp_calculate_x_pix(PROTO_DECL2 ufix8 start_edge,ufix8 end_edge,ufix16 constr_nr,fix31 x_scale,fix31 x_offset,fix31 ppo,fix15 setwidth_pix);
887 #endif
888 #if INCL_SQUEEZING
889 static void sp_calculate_y_pix(PROTO_DECL2 ufix8 start_edge,ufix8 end_edge,ufix16 constr_nr,fix31 top_scale,fix31 bottom_scale,fix31 ppo,fix15 emtop_pix,fix15 embot_pix);
890 boolean sp_calculate_x_scale(PROTO_DECL2 fix31 *x_factor,fix31 *x_offset,fix15 no_x_ctrl_zones);
891 boolean sp_calculate_y_scale(PROTO_DECL2 fix31 *top_scale,fix31 *bottom_scale,fix15 first_y_zone, fix15 no_Y_ctrl_zones);
892 #endif
893                   
894
895 /* user defined functions */
896
897 void sp_report_error(PROTO_DECL2 fix15 n);
898
899 #if INCL_BLACK || INCL_SCREEN || INCL_2D
900 void sp_open_bitmap(PROTO_DECL2 fix31 x_set_width, fix31 y_set_width, fix31 xorg, fix31 yorg, fix15 xsize,fix15 ysize);
901 void sp_set_bitmap_bits(PROTO_DECL2 fix15 y, fix15 xbit1, fix15 xbit2);
902 void sp_close_bitmap(PROTO_DECL1);
903 #endif
904
905 #if INCL_OUTLINE
906 void sp_open_outline(PROTO_DECL2 fix31 x_set_width, fix31 y_set_width, fix31 xmin, fix31 xmax, fix31 ymin,fix31 ymax);
907 void sp_start_new_char(PROTO_DECL1);
908 void sp_start_contour(PROTO_DECL2 fix31 x,fix31 y,boolean outside);
909 void sp_curve_to(PROTO_DECL2 fix31 x1, fix31 y1, fix31 x2, fix31 y2, fix31 x3, fix31 y3);
910 void sp_line_to(PROTO_DECL2 fix31 x, fix31 y);
911 void sp_close_contour(PROTO_DECL1);
912 void sp_close_outline(PROTO_DECL1);
913 #endif
914
915 #if INCL_LCD                     /* Dynamic load character data supported? */
916 buff_t *sp_load_char_data(PROTO_DECL2 fix31 file_offset,fix15 no_bytes,fix15 cb_offset);        /* Load character data from font file */
917 #endif
918
919 #if INCL_PLAID_OUT               /* Plaid data monitoring included? */
920 void   sp_record_xint(PROTO_DECL2 fix15 int_num);            /* Record xint data */
921 void   sp_record_yint(PROTO_DECL2 fix15 int_num);            /* Record yint data */
922 void sp_begin_plaid_data(PROTO_DECL1);         /* Signal start of plaid data */
923 void sp_begin_ctrl_zones(PROTO_DECL2 fix15, no_X_zones, fix15 no_Y_zones);         /* Signal start of control zones */
924 void sp_record_ctrl_zone(PROTO_DECL2 fix31 start, fix31 end, fix15 constr);         /* Record control zone data */
925 void sp_begin_int_zones(PROTO_DECL2 fix15 no_X_int_zones, fix15 no_Y_int_zones);          /* Signal start of interpolation zones */
926 void sp_record_int_zone(PROTO_DECL2 fix31 start, fix31 end);          /* Record interpolation zone data */
927 void sp_end_plaid_data(PROTO_DECL1);           /* Signal end of plaid data */
928 #endif
929
930 #else   /* NO PROTOTYPES AVAILABLE */
931
932
933
934 /*  do_char.c functions */
935 boolean sp_make_char();          /* Make specified character */
936 #if  INCL_ISW       
937 fix31 sp_compute_isw_scale();
938 static boolean sp_do_make_char();
939 boolean sp_make_char_isw();     /* Make specified character with */
940                                 /* imported set widths.*/
941 static boolean sp_reset_xmax();
942 #endif
943 #if INCL_ISW || INCL_SQUEEZING
944 static void sp_preview_bounding_box();
945 #endif
946 ufix16  sp_get_char_id();        /* Get character id for specified char */
947
948 #if INCL_METRICS                 /* Metrics functions supported? */
949 fix31   sp_get_char_width();     /* Get character width for specified char */
950 fix15   sp_get_track_kern();     /* Get track kerning for specified size */
951 fix31   sp_get_pair_kern();      /* Get kerning for specified char pair */
952 boolean sp_get_char_bbox();
953 #endif
954
955 /* do_trns.c functions */
956 ufix8 FONTFAR *sp_read_bbox();              /* Read bounding box */
957 void   sp_proc_outl_data();         /* Process outline data */
958
959 /* out_0c.c functions */
960 boolean sp_init_black();
961 boolean sp_begin_char_black();
962 void sp_begin_contour_black();
963 void sp_line_black();
964 boolean sp_end_char_black();
965
966 /* out_util.c functions */
967 #if INCL_BLACK || INCL_SCREEN || INCL_2D
968
969 void sp_init_char_out();
970 void sp_begin_sub_char_out();
971 void sp_curve_out();
972 void sp_end_contour_out();
973 void sp_end_sub_char_out();
974 void sp_init_intercepts_out();
975 void sp_restart_intercepts_out();
976 void sp_set_first_band_out();
977 void sp_reduce_band_size_out();
978 boolean sp_next_band_out();
979 #endif
980
981 #if INCL_USEROUT
982 boolean sp_init_userout();
983 #endif
984
985 /* reset.c functions */
986 void sp_reset();                 /* Initialize Fontware mechanism */
987
988 #if INCL_KEYS
989 void sp_set_key();
990 #endif
991 ufix16 sp_get_cust_no();
992
993 /* set_spcs.c functions */
994 boolean    sp_set_specs();       /* Set specifications */
995 void       sp_type_tcb();           /* Update transformation class in tcb */
996
997 fix31   sp_read_long();      /* Read long as 3 bytes encrypted */
998 fix15   sp_read_word_u();    /* Read word as 2 bytes unencrypted */
999
1000 /* set_trns.c functions */
1001 void    sp_init_tcb();              /* Initialize current trans control block */
1002 void    sp_scale_tcb();             /* Transform trans control block */
1003 ufix8 FONTFAR *sp_plaid_tcb();             /* Enable intelligent transformation */
1004 ufix8 FONTFAR *sp_skip_interpolation_table();
1005 ufix8 FONTFAR *sp_skip_control_zone();
1006
1007 ufix8 FONTFAR *sp_read_oru_table();    /* Read controlled coord table */
1008 #if INCL_SQUEEZING || INCL_ISW
1009 static void sp_calculate_x_pix();
1010 #endif
1011 #if INCL_SQUEEZING
1012 static void sp_calculate_y_pix();
1013 boolean sp_calculate_x_scale();
1014 boolean sp_calculate_y_scale() ;
1015 #endif
1016
1017 /* user defined functions */
1018
1019 #if INCL_BLACK || INCL_SCREEN || INCL_2D
1020 void sp_open_bitmap();
1021 void sp_set_bitmap_bits();
1022 void sp_close_bitmap();
1023 #endif
1024
1025 #if INCL_OUTLINE
1026 void sp_open_outline();
1027 void sp_start_new_char();
1028 void sp_start_contour();
1029 void sp_curve_to();
1030 void sp_line_to();
1031 void sp_close_contour();
1032 void sp_close_outline();
1033 #endif
1034
1035 #if INCL_LCD                     /* Dynamic load character data supported? */
1036 buff_t *sp_load_char_data();        /* Load character data from font file */
1037 #endif
1038
1039 #if INCL_PLAID_OUT               /* Plaid data monitoring included? */
1040 void   sp_record_xint();            /* Record xint data */
1041 void   sp_record_yint();            /* Record yint data */
1042 void sp_begin_plaid_data();         /* Signal start of plaid data */
1043 void sp_begin_ctrl_zones();         /* Signal start of control zones */
1044 void sp_record_ctrl_zone();         /* Record control zone data */
1045 void sp_begin_int_zones();          /* Signal start of interpolation zones */
1046 void sp_record_int_zone();          /* Record interpolation zone data */
1047 void sp_end_plaid_data();           /* Signal end of plaid data */
1048 #endif
1049
1050 boolean sp_init_screen();        /* If only screen-writer mode supported */
1051 boolean sp_begin_char_screen();      /* If screenwriter mode supported */
1052 void    sp_begin_contour_screen();   /* If screenwriter mode supported */
1053 void    sp_line_screen();            /* If screenwriter mode supported */
1054 void    sp_curve_screen();           /* If screenwriter mode supported */
1055 void sp_scan_curve_screen();
1056 void sp_vert_line_screen();
1057 void sp_end_contour_screen();
1058 boolean sp_end_char_screen();        /* If screenwriter mode supported */
1059
1060
1061 boolean sp_init_outline();        /* If only vector output mode supported */
1062 boolean sp_begin_char_outline();      /* If only vector output mode supported */
1063 void    sp_begin_sub_char_outline();  /* If only vector output mode supported */
1064 void    sp_begin_contour_outline();   /* If only vector output mode supported */
1065 void    sp_curve_outline();           /* If only vector output mode supported */
1066 void    sp_line_outline();            /* If only vector output mode supported */
1067 void    sp_end_contour_outline();     /* If only vector output mode supported */
1068 void    sp_end_sub_char_outline();    /* If only vector output mode supported */
1069 boolean sp_end_char_outline();        /* If only vector output mode supported */
1070
1071 boolean sp_init_2d();       /* If screen-writer and other modes supported */
1072 boolean sp_begin_char_2d();     /* If screen-writer and other modes supported */
1073 void    sp_begin_contour_2d();  /* If screen-writer and other modes supported */
1074 void    sp_line_2d();           /* If screen-writer and other modes supported */
1075 boolean sp_end_char_2d();       /* If screen-writer and other modes supported */
1076
1077 #endif
1078
1079
1080
1081 #endif /* _SPEEDO_H_ */