Back to index

tetex-bin  3.0
pkout.h
Go to the documentation of this file.
00001 /* 
00002  * FILE:    pkout.h
00003  *
00004  * PURPOSE: interface to te PK output functions (pkfile.c)
00005  *
00006  * COMMENT: See the pktest.c example program how to use the PK functions.
00007  *
00008  * VERSION: Febr. 1992
00009  *          Dec. 1993
00010  *
00011  * AUTHOR:  Piet Tutelaers (rcpt@urc.tue.nl)
00012  */
00013 
00014 #ifdef WORD16
00015 typedef long INT32;
00016 #else
00017 typedef int  INT32;
00018 #endif
00019 
00020 /* A function for opening a pk file */
00021 void pk_open(char *name);
00022 
00023 /* A function for closing a pk file */
00024 void pk_close();
00025 
00026 /* A function for writing the preamble */
00027 void pk_preamble(char *comment, /* comment string: source of font */
00028         float pointsize,        /* design size in points */
00029         INT32 checksum,         /* checksum */
00030         unsigned int h_res,     /* horizontal resolution (dpi) */
00031         unsigned int v_res);    /* vertical resolution (dpi) */
00032 
00033 /* For packing a character */
00034 void pk_char(int char_code,        /* character code 0..255 */
00035         INT32 tfm_width,        /* TFM width of character */
00036         int h_escapement,       /* horizontal escapement in pixels */
00037        unsigned int width,  /* width of bounding box */
00038        unsigned int height,        /* height of bounding box */
00039        int h_offset,               /* horizontal offset to reference point */
00040        int v_offset,               /* vertical offset to reference point */
00041        int (*next_pixel)());       /* user's pixel generator */
00042 
00043 /* Barebone postample */ 
00044 void pk_postamble();
00045 
00046 /* PS2PK postamble */
00047 void ps2pk_postamble(char *fontname, /* The real FontName from the afm */
00048                 char *encname,     /* The actual name, not the filename */
00049                 int base_res,      /* basic resolution */
00050                 int h_res,       /* Match against base_res for mag */
00051                 int v_res,       /* Match against h_res for aspect_ratio */
00052                 float pointsize,   /* Used for fontfacebyte calculation */
00053                 char *args);       /* Essential ps2pk args */
00054 
00055 /* Here are some definitions to play with pixels */
00056 #define BLACK 1
00057 #define WHITE   0
00058 #define OTHER(pixel) (pixel==BLACK? WHITE: BLACK)