home *** CD-ROM | disk | FTP | other *** search
/ Carousel Volume 2 #1 / carousel.iso / mactosh / unix / unix_dra.hqx / pxl.h < prev    next >
C/C++ Source or Header  |  1987-02-14  |  2KB  |  66 lines

  1. /* PXL file format */
  2.  
  3. /* Note:  PXL files are stored in the opposite of VAX byte order, which
  4.    means each group of 4 bytes must be reversed before using the info. */
  5.  
  6. #define PXLID 1001        /* PXL file ID number */
  7.  
  8. #ifndef PXLPATH
  9. #define PXLPATH "/usr/lib/tex/fonts"
  10.                 /* path to PXL font files.  The shell's
  11.                    convention of colon-separated names
  12.                    is honoured. */
  13. #endif  PXLPATH
  14.  
  15. #define FONT_SLOP 5        /* how much "slop" from the given
  16.                    magnification is permitted when looking
  17.                    for a font (e.g., if the computed size
  18.                    is 999, will try up to 999 +- FONT_SLOP,
  19.                    until something is found) */
  20.  
  21. /* chinfo is called the "font directory" by the PXL file description, but I
  22.    think that "character info" is a more accurate description.  Each group of
  23.    4 "words" is one of these things, and there are 128 such groups, one for
  24.    each character.
  25.  
  26.    Note that for empty characters ch_un.un_rastoff will be zero.
  27.  
  28.    The "#if vax" is for vax-dependent byte order stuff (I know, it's ugly).
  29.  */
  30. struct chinfo {
  31. #if vax || ns32000        /* little-endian order */
  32.     short   ch_height;
  33.     short   ch_width;
  34.     short   ch_yoffset;
  35.     short   ch_xoffset;
  36. #else                /* big-endian order */
  37.     short   ch_width;        /* character width */
  38.     short   ch_height;        /* character height */
  39.     short   ch_xoffset;        /* X offset of ref point */
  40.     short   ch_yoffset;        /* Y offset of ref point */
  41. #endif
  42.     union {
  43.     int     un_rastoff;    /* raster offset from word 0 */
  44.     char   *un_raster;    /* pointer to actual raster */
  45.     }               ch_un;
  46.     int     ch_TFMwidth;    /* TFM width (in FIXes) */
  47. };
  48. /* shorthand */
  49. #define ch_rastoff ch_un.un_rastoff
  50. #define ch_raster  ch_un.un_raster
  51.  
  52. /* The end of the PXL file looks like this */
  53. struct pxltail {
  54.     struct chinfo px_info[128];    /* "font directory" info */
  55.     int     px_checksum;    /* checksum */
  56.     int     px_magnification;    /* magnification factor */
  57.     int     px_designsize;    /* font design size (FIXes) */
  58.     int     px_dirpointer;    /* directory pointer */
  59.     int     px_pxlid;        /* pxlid, should be == PXLID */
  60. };
  61.  
  62. /* Function types */
  63. double DMagFactor ();
  64. char  *GenPXLFileName ();
  65. struct pxltail *ReadPXLFile ();
  66.