1 // 2 // These definitions are for the Postscript (ps.c) and 3 // Postscript/LaTeX (pstex.c) drivers 4 // 5 6 #ifndef __PS_H__ 7 #define __PS_H__ 8 9 #include "plunicode-type1.h" 10 11 // top level declarations 12 13 #define LINELENGTH 78 14 #define COPIES 1 15 #define XSIZE (int) ( pls->xlength * ( pls->xdpi / 72. ) ) 16 #define YSIZE (int) ( pls->ylength * ( pls->ydpi / 72. ) ) 17 #define ENLARGE 5 18 #define XPSSIZE ENLARGE * XSIZE 19 #define YPSSIZE ENLARGE * YSIZE 20 #define XOFFSET (int) ( pls->xoffset * ( pls->xdpi / 72. ) ) // Margins -- 21 #define YOFFSET (int) ( pls->yoffset * ( pls->ydpi / 72. ) ) // .5 inches each 22 #define PSX XPSSIZE - 1 23 #define PSY YPSSIZE - 1 24 #define OF pls->OutFile 25 #define MIN_WIDTH 1. // Minimum pen width 26 #define MAX_WIDTH 30. // Maximum pen width 27 #define DEF_WIDTH 3. // Default pen width 28 29 // These are for covering the page with the background color 30 31 #define XMIN -XOFFSET * ENLARGE 32 #define XMAX PSX + XOFFSET * ENLARGE 33 #define YMIN -XOFFSET * ENLARGE 34 #define YMAX PSY + XOFFSET * ENLARGE 35 36 // Struct to hold device-specific info. 37 38 typedef struct 39 { 40 PLFLT pxlx, pxly; 41 PLINT xold, yold; 42 43 PLINT xmin, xmax, xlen; 44 PLINT ymin, ymax, ylen; 45 46 PLINT xmin_dev, xmax_dev, xlen_dev; 47 PLINT ymin_dev, ymax_dev, ylen_dev; 48 49 PLFLT xscale_dev, yscale_dev; 50 51 int llx, lly, urx, ury, ptcnt; 52 // font variables. 53 int nlookup, if_symbol_font; 54 const Unicode_to_Type1_table *lookup; 55 56 // These are only used by the pstex driver for the additional 57 // file required in this case 58 long cur_pos; 59 FILE *fp; 60 } PSDev; 61 62 void plD_init_pstex( PLStream * ); 63 void plD_line_pstex( PLStream *, short, short, short, short ); 64 void plD_polyline_pstex( PLStream *, short *, short *, PLINT ); 65 void plD_eop_pstex( PLStream * ); 66 void plD_bop_pstex( PLStream * ); 67 void plD_tidy_pstex( PLStream * ); 68 void plD_state_pstex( PLStream *, PLINT ); 69 void plD_esc_pstex( PLStream *, PLINT, void * ); 70 71 void plD_init_ps( PLStream * ); 72 void plD_init_psc( PLStream * ); 73 void plD_line_ps( PLStream *, short, short, short, short ); 74 void plD_polyline_ps( PLStream *, short *, short *, PLINT ); 75 void plD_eop_ps( PLStream * ); 76 void plD_bop_ps( PLStream * ); 77 void plD_tidy_ps( PLStream * ); 78 void plD_state_ps( PLStream *, PLINT ); 79 void plD_esc_ps( PLStream *, PLINT, void * ); 80 81 void plD_init_psttf( PLStream * ); 82 void plD_init_psttfc( PLStream * ); 83 void plD_line_psttf( PLStream *, short, short, short, short ); 84 void plD_polyline_psttf( PLStream *, short *, short *, PLINT ); 85 void plD_eop_psttf( PLStream * ); 86 void plD_bop_psttf( PLStream * ); 87 void plD_tidy_psttf( PLStream * ); 88 void plD_state_psttf( PLStream *, PLINT ); 89 void plD_esc_psttf( PLStream *, PLINT, void * ); 90 91 #endif // __PS_H__ 92