Back to index

tetex-bin  3.0
pkin.h
Go to the documentation of this file.
00001 /*
00002  * NAME
00003  *     pkin.h - header file for readchar()
00004  * SYNOPSIS
00005  *     #include "pkfile.h"
00006  *
00007  *     int readchar(name, c, cd)
00008  *     char name[]; shalfword c; chardesc *cd;
00009  * DESCRIPTION
00010  *     Readchar() opens the pkfile `name', checks if it's a legal pkfile,
00011  *     and reads the character description of `c' into `cd'. Readchar()
00012  *     returns TRUE (1) upon success, FALSE (0) if the character `c' is
00013  *     not found in the pkfile.
00014  *
00015  *     Parameter `cd' is a pointer to a the following structure:
00016  *          typedef struct {
00017  *            integer charcode,    
00018  *                     cwidth, cheight,
00019  *                    xoff, yoff;
00020  *            halfword *raster ;
00021  *            } chardesc ;
00022  *
00023  *     Charcode is the code of the character returned, cwidth and cheight
00024  *     respectively the width and height of the character in pixels,
00025  *     xoff and yoff are the offsets of first pixel to the reference point
00026  *     of the character box.
00027  *     Raster is a pointer to the bitmap describing the character. This
00028  *     raster consists of cheight rows of (cwidth + 15) /16 words of 
00029  *     16 bits each. Each row contains from left to right all cwidth
00030  *     pixels of that row.
00031  * WARNING
00032  *     If the machine has a default integer size of 16 bits, and 32-bit
00033  *     integers must be manipulated with %ld, be carefull!
00034  * AUTHORS
00035  *     Piet Tutelaers
00036  *     rcpt@urc.tue.nl
00037  */
00038  
00039 #include <stdio.h>
00040 #include <stdlib.h>
00041 /*
00042  *   Type declarations.  integer must be a 32-bit signed; shalfword must
00043  *   be a sixteen-bit signed; halfword must be a sixteen-bit unsigned;
00044  *   quarterword must be an eight-bit unsigned.
00045  */
00046 typedef long integer;
00047 typedef short shalfword ;
00048 typedef unsigned short halfword ;
00049 typedef unsigned char quarterword ;
00050 typedef short Boolean ;
00051 /*
00052  *   A chardesc describes an individual character. 
00053  */
00054 typedef struct {
00055    integer charcode,
00056            cwidth, cheight,
00057           xoff, yoff;
00058    halfword *raster ;
00059 } chardesc ;
00060 
00061 int readchar();