| 1 |
greg |
2.7 |
/* RCSid $Id: font.h,v 2.6 2003/06/06 16:38:47 schorsch Exp $ */ |
| 2 |
greg |
2.1 |
/* |
| 3 |
|
|
* Header file for font handling routines |
| 4 |
|
|
*/ |
| 5 |
schorsch |
2.6 |
#ifndef _RAD_FONT_H_ |
| 6 |
|
|
#define _RAD_FONT_H_ |
| 7 |
|
|
#ifdef __cplusplus |
| 8 |
|
|
extern "C" { |
| 9 |
|
|
#endif |
| 10 |
greg |
2.4 |
|
| 11 |
greg |
2.1 |
typedef unsigned char GORD; |
| 12 |
|
|
|
| 13 |
|
|
typedef struct { |
| 14 |
|
|
short nverts; /* number of vertices */ |
| 15 |
greg |
2.2 |
GORD left, right, top, bottom; /* glyph extent */ |
| 16 |
greg |
2.1 |
/* followed by vertex list */ |
| 17 |
|
|
} GLYPH; |
| 18 |
|
|
|
| 19 |
|
|
#define gvlist(g) ((GORD *)((g)+1)) |
| 20 |
|
|
|
| 21 |
|
|
typedef struct font { |
| 22 |
greg |
2.4 |
int nref; /* number of references */ |
| 23 |
greg |
2.1 |
GLYPH *fg[256]; /* font glyphs */ |
| 24 |
greg |
2.3 |
short mwidth, mheight; /* mean glyph width and height */ |
| 25 |
greg |
2.1 |
char *name; /* font file name */ |
| 26 |
|
|
struct font *next; /* next font in list */ |
| 27 |
|
|
} FONT; |
| 28 |
|
|
|
| 29 |
greg |
2.4 |
extern int retainfonts; /* retain loaded fonts? */ |
| 30 |
|
|
|
| 31 |
|
|
|
| 32 |
|
|
extern FONT *getfont(char *fname); |
| 33 |
|
|
extern void freefont(FONT *f); |
| 34 |
|
|
extern int uniftext(short *sp, char *tp, FONT *f); |
| 35 |
|
|
extern int squeeztext(short *sp, char *tp, FONT *f, int cis); |
| 36 |
|
|
extern int proptext(short *sp, char *tp, FONT *f, int cis, int nsi); |
| 37 |
|
|
|
| 38 |
schorsch |
2.6 |
|
| 39 |
|
|
#ifdef __cplusplus |
| 40 |
|
|
} |
| 41 |
greg |
2.4 |
#endif |
| 42 |
schorsch |
2.6 |
#endif /* _RAD_FONT_H_ */ |
| 43 |
|
|
|