1 /* 2 * FILE: pkout.h 3 * 4 * PURPOSE: interface to te PK output functions (pkfile.c) 5 * 6 * COMMENT: See the pktest.c example program how to use the PK functions. 7 * 8 * VERSION: 1.7 (December 2014) 9 * 10 * AUTHOR: Piet Tutelaers (rcpt@urc.tue.nl) 11 */ 12 13 /* A function for opening a pk file */ 14 void pk_open(char *name); 15 16 /* A function for closing a pk file */ 17 void pk_close(void); 18 19 /* A function for writing the preamble */ 20 void pk_preamble(char *comment, /* comment string: source of font */ 21 float pointsize, /* design size in points */ 22 int32_t checksum, /* checksum */ 23 unsigned int h_res, /* horizontal resolution (dpi) */ 24 unsigned int v_res); /* vertical resolution (dpi) */ 25 26 /* For packing a character */ 27 void pk_char(int char_code, /* character code 0..255 */ 28 int32_t tfm_width, /* TFM width of character */ 29 int h_escapement, /* horizontal escapement in pixels */ 30 unsigned int width, /* width of bounding box */ 31 unsigned int height, /* height of bounding box */ 32 int h_offset, /* horizontal offset to reference point */ 33 int v_offset, /* vertical offset to reference point */ 34 int (*next_pixel)()); /* user's pixel generator */ 35 36 /* Barebone postample */ 37 void pk_postamble(void); 38 39 /* PS2PK postamble */ 40 void ps2pk_postamble(char *fontname, /* The real FontName from the afm */ 41 char *encname, /* The actual name, not the filename */ 42 int base_res, /* basic resolution */ 43 int h_res, /* Match against base_res for mag */ 44 int v_res, /* Match against h_res for aspect_ratio */ 45 float pointsize, /* Used for fontfacebyte calculation */ 46 char *args); /* Essential ps2pk args */ 47 48 /* Here are some definitions to play with pixels */ 49 #define BLACK 1 50 #define WHITE 0 51 #define OTHER(pixel) (pixel==BLACK? WHITE: BLACK) 52