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