home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume10 / lemming / part01 / lemfont.h < prev    next >
Encoding:
C/C++ Source or Header  |  1987-08-05  |  1.3 KB  |  48 lines

  1. /* lemfont.c - routines to create and access binary level strike fonts
  2.  *
  3.  * copywrite (c) 1985, by Alan W. Paeth. All rights reserved
  4.  * 
  5.  * Programmed by Alan Paeth, University of Waterloo, February, 1984
  6.  *
  7.  * NOTE: these fonts began life as 16-bit integers, with opposite byte-
  8.  * order conventions of the VAX. This explains the appearance of short
  9.  * integers, and size counts done in terms of shorts.
  10.  *
  11.  * Also, fonts are represented as a pointer to a contiguous, variable-
  12.  * length structure. Because the actual bitmap is the only data part
  13.  * which varies from font to font, its declaration is ultimate in the
  14.  * structure declaration. FONTHEADERSIZE is the short word offset to it.
  15.  *
  16.  * patched by Alan Paeth, May 1985, to deal with null print strings
  17.  */
  18.  
  19. /* MAX WIDTH */
  20.  
  21. #define LEFT 0
  22. #define RIGHT screenw
  23. #define TOP screenh
  24. #define BOTTOM 0
  25.  
  26. #define MAXWIDTH 1024
  27.  
  28. /* BFont structure - returned by BFontload() */
  29.  
  30. typedef struct BFont_type
  31.     {
  32.     short ascent;
  33.     short descent;
  34.     short mwidth;
  35.     short rasterx;    /* strike scan line length expressed in short ints */
  36.     short widths[257];  /* 257 boundaries between a strike of 256 chars */
  37.     short glyphs[1];    /* var len glyphs starts after FONTHEADSIZE shorts */
  38.     } *BFont;
  39.  
  40. BFont fontload();
  41.  
  42. /* offset to beginning of the glyphs */
  43.  
  44. #define FONTHEADERSIZE 261
  45.  
  46.  
  47. extern BFont bfont[];
  48.