home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / APPS / DVI_MGR / dvimgr_s.lzh / dvimgr / gblvars.h < prev    next >
Text File  |  1993-08-06  |  14KB  |  326 lines

  1. /* -*-C-*- gblvars.h */
  2. /*-->gblvars*/
  3. /* constant for font-list corrected, GF */
  4. /**********************************************************************/
  5. /****************************** gblvars *******************************/
  6. /**********************************************************************/
  7.  
  8. /**********************************************************************/
  9. /*********************  General Global Variables  *********************/
  10. /**********************************************************************/
  11.  
  12. char curpath[MAXFNAME];            /* current file area */
  13. char curext[MAXFNAME];            /* current file extension */
  14. char curname[MAXFNAME];            /* current file name */
  15.  
  16. UNSIGN16 debug_code;            /* 0 for no debug output */
  17.  
  18. char dviname[MAXFNAME];            /* DVI filespec */
  19. char dvoname[MAXFNAME];            /* device output filespec */
  20.  
  21. char fontlist[MAXSTR];            /* FONTLIST environment string */
  22. char fontpath[MAXFNAME];        /* font directory path */
  23.  
  24. char helpcmd[MAXSTR];            /* where to look for help */
  25.  
  26. char message[MAXMSG];            /* for formatting error messages */
  27.  
  28. /***********************************************************************
  29. Magnification table for 144dpi, 200dpi, and 300dpi devices, computed
  30. to 20 figures and sorted by magnitude.
  31.  
  32.     Column 1         Column 2         Column 3
  33. 0.72*sqrt(1.2)**i  sqrt(1.2)**I  1.5*sqrt(1.2)**I    (I = -16,16)
  34.  
  35. ***********************************************************************/
  36.  
  37. static float mag_table[] =
  38.     {
  39.     0.16744898601451165028, 0.18343117374303022733, 0.20093878321741398034,
  40.     0.22011740849163627280, 0.23256803936137783874, 0.24112653986089677641,
  41.     0.25476552262595201888, 0.26414089018996352736, 0.27908164723365340649,
  42.     0.28935184783307613169, 0.30571862715114242265, 0.31696906822795623283,
  43.     0.33489797668038408779, 0.34722221739969135802, 0.34885205904206675812,
  44.     0.36686235258137090718, 0.38036288187354747940, 0.38214828393892802832,
  45.     0.40187757201646090535, 0.41666666087962962963, 0.41862247085048010974,
  46.     0.44023482309764508862, 0.45643545824825697527, 0.45857794072671363398,
  47.     0.48225308641975308642, 0.49999999305555555556, 0.50234696502057613169,
  48.     0.52828178771717410634, 0.54772254989790837033, 0.55029352887205636077,
  49.     0.57870370370370370370, 0.59999999166666666667, 0.60281635802469135802,
  50.     0.63393814526060892761, 0.65726705987749004440, 0.66035223464646763293,
  51.     0.69444444444444444444, 0.71999999000000000000, 0.72337962962962962963,
  52.     0.76072577431273071313, 0.78872047185298805327, 0.79242268157576115952,
  53.     0.83333333333333333333, 0.86399998800000000000, 0.86805555555555555556,
  54.     0.91287092917527685576, 0.94646456622358566393, 0.95090721789091339142,
  55.     1.00000000000000000000, 1.03679998560000000000, 1.04166666666666666670,
  56.     1.09544511501033222690, 1.13575747946830279670, 1.14108866146909606970,
  57.     1.20000000000000000000, 1.24415998272000000000, 1.25000000000000000000,
  58.     1.31453413801239867230, 1.36290897536196335610, 1.36930639376291528360,
  59.     1.44000000000000000000, 1.49299197926400000000, 1.50000000000000000000,
  60.     1.57744096561487840680, 1.63549077043435602730, 1.64316767251549834040,
  61.     1.72800000000000000000, 1.79159037511680000000, 1.80000000000000000000,
  62.     1.89292915873785408810, 1.96258892452122723270, 1.97180120701859800840,
  63.     2.07360000000000000000, 2.14990845014016000000, 2.16000000000000000000,
  64.     2.27151499048542490570, 2.35510670942547267930, 2.36616144842231761010,
  65.     2.48832000000000000000, 2.57989014016819200000, 2.59200000000000000000,
  66.     2.72581798858250988690, 2.82612805131056721510, 2.83939373810678113220,
  67.     2.98598400000000000000, 3.09586816820183040000, 3.11040000000000000000,
  68.     3.27098158629901186430, 3.40727248572813735860, 3.58318080000000000000,
  69.     3.73248000000000000000, 3.92517790355881423710, 4.08872698287376483030,
  70.     4.29981696000000000000, 4.47897600000000000000, 4.90647237944851779640,
  71.     5.37477120000000000000, 5.88776685533822135560, 6.44972544000000000000
  72.     };
  73.  
  74. INT16 mag_index;        /* set by actfact */
  75.  
  76. #define MAGTABSIZE (sizeof(mag_table) / sizeof(float))
  77.  
  78. int g_errenc = 0;        /* has an error been encountered?      */
  79. char g_logname[MAXSTR];        /* name of log file, if created          */
  80. BOOLEAN g_dolog = TRUE;        /* allow log file creation          */
  81. FILE *g_logfp = (FILE*)NULL;    /* log file pointer (for errors)      */
  82. char g_progname[MAXSTR];    /* program name                  */
  83.  
  84. FILE *plotfp = (FILE*)NULL;    /* plot file pointer              */
  85.  
  86. struct char_entry
  87. {                /* character entry              */
  88.    COORDINATE wp, hp;        /* width and height in pixels          */
  89.    COORDINATE xoffp, yoffp;    /* x offset and y offset in pixels      */
  90.    long fontrp;            /* font file raster pointer          */
  91.    UNSIGN32 tfmw;        /* TFM width                  */
  92.    INT32 dx, dy;        /* character escapements          */
  93.    UNSIGN16 pxlw;        /* pixel width == round(TFM width in      */
  94.                 /* pixels for .PXL files, or          */
  95.                 /* float(char_dx)/65536.0 for .GF and .PK */
  96.                 /* files)                  */
  97.    INT16 refcount;        /* reference count for memory management  */
  98.    UNSIGN32 *rasters;        /* raster description (dynamically loaded) */
  99.  
  100. #if    (HPJETPLUS | POSTSCRIPT | IMPRESS | CANON_A2)
  101.    BOOLEAN isloaded;        /* is the character already downloaded?   */
  102. #endif /* (HPJETPLUS | POSTSCRIPT | IMPRESS | CANON_A2) */
  103.  
  104. #if    HPJETPLUS
  105.    BOOLEAN istoobig;        /* Too big (or too odd) to be loaded */
  106. #endif
  107.  
  108. #if    CANON_A2
  109.    BOOLEAN isknown;        /* Character is known */
  110.    BOOLEAN istoobig;        /* Too big to be loaded */
  111. #endif
  112.  
  113. #if    BBNBITGRAPH
  114.    BOOLEAN istoobig;        /* is the character too big for BitGraph? */
  115.    BOOLEAN isloaded;        /* is the character loaded in the BitGraph?*/
  116.    INT16 bgfont, bgchar;    /* BitGraph font and character          */
  117. #endif /* BBNBITGRAPH */
  118.  
  119. };
  120.  
  121. struct font_entry
  122. {
  123.     struct font_entry *next;    /* pointer to next font entry           */
  124.     void (*charxx)();        /* pointer to chargf(), charpk(), charpxl()*/
  125.     FILE *font_file_id;        /* file identifier (NULL if none)       */
  126.     INT32 k;            /* font number                             */
  127.     UNSIGN32 c;            /* checksum                                */
  128.     UNSIGN32 d;            /* design size                             */
  129.     UNSIGN32 s;            /* scale factor                            */
  130.     INT32 font_space;        /* computed from FNT_DEF s parameter       */
  131.     UNSIGN32 font_mag;        /* computed from FNT_DEF s and d parameters*/
  132.     UNSIGN32 magnification;    /* magnification read from PXL file       */
  133.     UNSIGN32 designsize;    /* design size read from PXL file       */
  134.     UNSIGN32 hppp;        /* horizontal pixels/point * 2**16       */
  135.     UNSIGN32 vppp;        /* vertical pixels/point * 2**16       */
  136.     INT32 min_m;        /* GF bounding box values           */
  137.     INT32 max_m;
  138.     INT32 min_n;
  139.     INT32 max_n;
  140.  
  141. #if    (CANON_A2 | HPJETPLUS | IMPRESS | POSTSCRIPT)
  142.     UNSIGN16 font_number;    /* font number (0..32767) */
  143. #endif /* (CANON_A2 | HPJETPLUS | IMPRESS | POSTSCRIPT) */
  144.  
  145. #if    CANON_A2
  146.     COORDINATE cell_w;
  147.     COORDINATE cell_h;
  148.     COORDINATE cell_d;
  149.     UNSIGN16 nloaded;
  150.     UNSIGN32 storage;
  151. #endif /* CANON_A2 */
  152.  
  153.     BYTE font_type;        /* GF, PK, or PXL font file           */
  154.     BYTE a;            /* length of font area in n[]              */
  155.     BYTE l;            /* length of font name in n[]              */
  156.     char n[MAXSTR];        /* font area and name                      */
  157.     char name[MAXSTR];        /* full name of PXL file           */
  158.     struct char_entry ch[NPXLCHARS];/* character information           */
  159. };
  160.  
  161. struct font_list
  162. {
  163.     FILE *font_id;        /* file identifier               */
  164.     INT16 use_count;        /* count of "opens"               */
  165. };
  166.  
  167. INT32 cache_size;        /* record of how much character raster        */
  168.                 /* is actually used                */
  169. float conv;            /* converts DVI units to pixels            */
  170. UNSIGN16 copies;        /* number of copies to print of each page   */
  171. INT16 cur_page_number;        /* sequential output page number in 1..N    */
  172. INT16 cur_index;        /* current index in page_ptr[]              */
  173.  
  174. COORDINATE xcp,ycp;        /* current position                */
  175. UNSIGN32 den;            /* denominator specified in preamble        */
  176. FILE *dvifp = (FILE*)NULL;    /* DVI file pointer                */
  177. struct font_entry *fontptr;    /* font_entry pointer                */
  178. struct font_entry *hfontptr = (struct font_entry *)NULL;
  179.                 /* head font_entry pointer            */
  180.  
  181. #if    (CANON_A2 | HPJETPLUS | IMPRESS | POSTSCRIPT)
  182. UNSIGN16 font_count;        /* used to assign unique font numbers        */
  183. struct font_entry *font_table[MAXFONTS];
  184. #endif /* (CANON_A2 | HPJETPLUS | IMPRESS | POSTSCRIPT) */
  185.  
  186. #if    (HPJETPLUS | POSTSCRIPT | IMPRESS | CANON_A2)
  187. BOOLEAN font_switched;        /* current font has changed            */
  188. #endif /* (HPJETPLUS | POSTSCRIPT | IMPRESS | CANON_A2) */
  189.  
  190. INT16 gf_index, pk_index, pxl_index;
  191.                 /* indexes into filelist[] in fontfile();   */
  192.                 /* they define the search order, and are    */
  193.                 /* in initglob().                */
  194. UNSIGN32 gpower[33];        /* gpower[k] = 2**k-1 (k = 0..32)        */
  195. INT32 h;            /* current horizontal position            */
  196. COORDINATE hh;            /* current horizontal position in pixels    */
  197.  
  198. #if    HPLASERJET
  199. INT16 hpres;            /* output resolution (75, 100, 150, 300 dpi) */
  200. #endif /* HPLASERJET */
  201.  
  202. UNSIGN32 img_mask[32];        /* initialized at run-time so that bit k    */
  203.                 /* (counting from high end) is one        */
  204. UNSIGN32 img_row[(MAX_M - MIN_M + 1 + 31) >> 5];
  205.                 /* current character image row of bits        */
  206. INT16 max_m, min_m, max_n, min_n;
  207.                 /* current character matrix extents        */
  208. UNSIGN16 img_words;        /* number of words in use in img_row[]        */
  209. float leftmargin;        /* left margin in inches            */
  210. COORDINATE lmargin;        /* left margin offset in pixels            */
  211. INT16 nopen;            /* number of open PXL files            */
  212. INT16 page_count;        /* number of entries in page_ptr[]        */
  213.  
  214. #if    HPJETPLUS
  215. INT16 page_fonts;        /* count of fonts used on current page      */
  216. #endif /* HPJETPLUS */
  217.  
  218. long page_ptr[MAXPAGE+1];    /* byte pointers to pages (reverse order)   */
  219.  
  220. #if    POSTSCRIPT
  221. long page_loc[MAXPAGE+1];    /* byte pointers to output pages        */
  222. INT32 page_tex[MAXPAGE+1];    /* TeX's \count0 page numbers            */
  223. #endif /* POSTSCRIPT */
  224.  
  225. INT16 page_begin[MAXREQUEST+1],
  226.     page_end[MAXREQUEST+1],
  227.     page_step[MAXREQUEST+1];    /* explicit page range requests            */
  228. INT16 npage;            /* number of explicit page range requests   */
  229. struct font_list font_files[MAXFONTS+1];
  230.                 /* list of open PXL file identifiers        */
  231.  
  232. UNSIGN32 power[32];        /* power[k] = 1 << k                */
  233.  
  234. #if    POSTSCRIPT
  235. BOOLEAN ps_vmbug;        /* reload fonts on each page when TRUE        */
  236. #endif /* POSTSCRIPT */
  237.  
  238. UNSIGN32 rightones[HOST_WORD_SIZE];/* bit masks */
  239.  
  240. #if    (APPLEIMAGEWRITER | EPSON | DECLA75 | DECLN03PLUS)
  241. BOOLEAN runlengthcode = FALSE;        /* this is runtime option '-r' */
  242. #endif /* (APPLEIMAGEWRITER | EPSON | DECLA75 | DECLN03PLUS) */
  243.  
  244. #if    (GOLDENDAWNGL100 | TOSHIBAP1351)
  245. BOOLEAN runlengthcode = FALSE;        /* this is runtime option '-r' */
  246. #endif /* (GOLDENDAWNGL100 | TOSHIBAP1351) */
  247.  
  248. UNSIGN32 runmag;        /* runtime magnification            */
  249. UNSIGN32 mag;            /* magnification specified in preamble        */
  250. UNSIGN32 num;            /* numerator specified in preamble        */
  251. struct font_entry *pfontptr = (struct font_entry *)NULL;
  252.                 /* previous font_entry pointer            */
  253. BOOLEAN preload = TRUE;        /* preload the font descriptions?        */
  254. FILE *fontfp = (FILE*)NULL;    /* font file pointer                */
  255.  
  256. BOOLEAN quiet = FALSE;        /* suppress status display when TRUE        */
  257.  
  258. BOOLEAN backwards = FALSE;    /* print in backwards order            */
  259.  
  260. #if    (CANON_A2 | HPJETPLUS | IMPRESS | POSTSCRIPT)
  261. COORDINATE rule_height;        /* parameters of last rule set */
  262. COORDINATE rule_width;
  263. COORDINATE str_ycp;        /* last string ycp value */
  264. UNSIGN16 size_limit;        /* character size limit in pixels -- larger */
  265.                 /* characters are downloaded each time they */
  266.                 /* are required to avoid PostScript ROM bugs */
  267. #endif /* (CANON_A2 | HPJETPLUS | IMPRESS | POSTSCRIPT) */
  268.  
  269. #if    (BSD42 | OS_TOPS20)
  270. BOOLEAN spool_output = FALSE;    /* offer to send output to spooler */
  271. #endif /* (BSD42 | OS_TOPS20) */
  272.  
  273. char subpath[MAXFNAME];        /* font substitution file path            */
  274. char subname[MAXFNAME];        /* font substitution file name field        */
  275. char subext[MAXFNAME];        /* font substitution file extension field   */
  276. char subfile[MAXFNAME];        /* font substitution filename            */
  277.  
  278. INT32 tex_counter[10];        /* TeX c0..c9 counters on current page      */
  279. float topmargin;        /* top margin in inches                */
  280. COORDINATE tmargin;        /* top margin offset in pixels            */
  281.  
  282. INT32 v;            /* current vertical position            */
  283.  
  284. #if    VIRTUAL_FONTS
  285. BOOLEAN virt_font;        /* virtual font cache flag                  */
  286. struct virt_data
  287.     {
  288.     int    cnt;
  289.     char    *ptr;
  290.     char    *base;
  291.     };
  292. struct virt_data virt_save[_NFILE];/* space for saving old FILE values      */
  293. #endif /* VIRTUAL_FONTS */
  294.  
  295. COORDINATE vv;            /* current vertical position in pixels        */
  296.  
  297. #if    BBNBITGRAPH
  298. struct char_entry *bgcp[NBGFONTS+(NBGFONTS+2)/3][NPXLCHARS];
  299.     /* Pointer to corresponding char_entry for this BitGraph font */
  300.     /* and character.  These are used to set the char_entry's */
  301.     /* status to "not loaded" when we have to reuse the BitGraph */
  302.     /* character.  The array is cleared initially in devinit(). */
  303.  
  304. INT16 fullfont = 0;        /* full font to load in BitGraph        */
  305. BOOLEAN g_interactive=TRUE;    /* is the program running interactively   */
  306.                 /* (i.e., standard output not redirected)? */
  307. INT16 partchar = FIRSTBGCHAR;    /* partial font character to load in BitGraph*/
  308. INT16 partfont = NBGFONTS;    /* partial font to load in BitGraph        */
  309. INT16 pbghpos;            /* previous BitGraph horizontal position    */
  310. INT16 pbgvpos;            /* previous BitGraph vertical position        */
  311. INT16 pbgf = -1;        /* previous BitGraph font            */
  312. COORDINATE xdiff;        /* x difference                    */
  313. COORDINATE xscreen;        /* x screen adjustment                */
  314. COORDINATE ydiff;        /* y difference                    */
  315. COORDINATE yscreen;        /* y screen adjustment                */
  316. long cpagep;            /* pointer to current page in DVI file        */
  317. long ppagep;            /* pointer to previous page in DVI file     */
  318.  
  319. #if    OS_TOPS20
  320. #define jfn_plotfp (jfnof(fileno(plotfp)))
  321.  
  322. int bg_length,bg_width,bg_1ccoc,bg_2ccoc,bg_modeword,bg_sysmsg;
  323. #endif /* OS_TOPS20 */
  324.  
  325. #endif /* BBNBITGRAPH */
  326.