home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 2 / 2099 / pk.h
C/C++ Source or Header  |  1990-12-28  |  3KB  |  89 lines

  1. /*    Copyright 1985, 1986, 1987, 1988 16:47:03 Chris Lewis
  2.         All Rights Reserved
  3.  
  4.     Permission to copy and further distribute is freely given provided
  5.     this copyright notice remains intact and that this software is not
  6.     sold for profit.
  7.  
  8.     Project:    Generic Troff drivers
  9.     Module:        pk.h
  10.     Author:     Chris Lewis
  11.     Specs:        PK format font file description
  12.  */
  13.  
  14. #ifdef    PK
  15.  
  16. #define    int8    unsigned char
  17. #define    PK_ID    89
  18. #define    PK_xxx1    240
  19. #define    PK_xxx2    241
  20. #define    PK_xxx3    242
  21. #define    PK_xxx4    243
  22. #define    PK_yyy    244
  23. #define    PK_post    245
  24. #define    PK_no_op    246
  25. #define    PK_pre    247
  26.  
  27. /*    PK header data */
  28. struct pkp {
  29. #define    PK_PK    01
  30. #define    PK_SFP    02
  31.     long pkp_ds;    /* design size */
  32.     long pkp_npts;    /* pointsize normalized to 300 dpi */
  33.     long pkp_res;    /* resolution of this font */
  34.     long pkp_cs;    /* checksum */
  35.     long pkp_hppp;    /* Horizontal pixel ratio */
  36.     long pkp_vppp;    /* Vertical pixel ratio */
  37.     long pkp_bmax;    /* baseline max */
  38.     long pkp_dmax;    /* descender max */
  39.     long pkp_wmax;    /* width max */
  40.     long pkp_xomax;    /* left offset max */
  41.     long pkp_kh;    /* kern high */
  42.     long pkp_kl;    /* kern low */
  43.     struct pkc *pkp_chars;    /* pointer to character descriptors */
  44.     struct pkc *pkp_last;    /* pointer to last character descriptor */
  45.     struct pkc **pkp_list;    /* pointer to sorted list of descriptors */
  46.     long pkp_num;    /* number of characters */
  47.     int pkp_symset;    /* symbol set */
  48.     char pkp_flags;    /* font format */
  49.     char pkp_style;    /* style */
  50.     char pkp_sw;    /* stroke weight */
  51.     char pkp_typeface;    /* typeface */
  52. };
  53.  
  54. struct pkp *pk_read();
  55.  
  56. struct pkc {
  57.     long pkc_flag;    /* flag byte */
  58.     long pkc_dyn_f;    /* dynamic packing byte */
  59.     long pkc_pl;    /* packet length */
  60.     long pkc_char;    /* character code */
  61.     long pkc_tfm;    /* TeX font metrics */
  62.     long pkc_dx;    /* Horizontal escapement */
  63.     long pkc_dy;    /* Vertical escapement */
  64.     long pkc_width;    /* character width of BB */
  65.     long pkc_height;    /* character height of BB */
  66.     long pkc_x_off;    /* horizontal offset from upper left pixel to ref. */
  67.     long pkc_y_off;    /* vertical offset from upper left pixel to ref. */
  68.     long turnon;    /* used for unravelling bits */
  69.     long pkc_rlen;    /* actual raster length */
  70.     int8 *pkc_pkr;    /* actual PK raster */
  71.     struct ras *pkc_sfpr;    /* SFP raster */
  72.     struct pkc *pkc_next;    /* next character */
  73. };
  74.  
  75. struct ras {
  76.     long ras_width;
  77.     long ras_height;
  78.     long ras_bline;
  79.     long ras_bytes;
  80.     long ras_xcur;
  81.     long ras_ycur;
  82.     int8 *ras_raster;
  83. };
  84.  
  85. #define    pow2(x)    (1L << (x))
  86.  
  87. #define    OUTRES    300
  88. #endif
  89.