1 |
/* RCSid $Id: font.h,v 2.6 2003/06/06 16:38:47 schorsch Exp $ */ |
2 |
/* |
3 |
* Header file for font handling routines |
4 |
*/ |
5 |
#ifndef _RAD_FONT_H_ |
6 |
#define _RAD_FONT_H_ |
7 |
#ifdef __cplusplus |
8 |
extern "C" { |
9 |
#endif |
10 |
|
11 |
typedef unsigned char GORD; |
12 |
|
13 |
typedef struct { |
14 |
short nverts; /* number of vertices */ |
15 |
GORD left, right, top, bottom; /* glyph extent */ |
16 |
/* followed by vertex list */ |
17 |
} GLYPH; |
18 |
|
19 |
#define gvlist(g) ((GORD *)((g)+1)) |
20 |
|
21 |
typedef struct font { |
22 |
int nref; /* number of references */ |
23 |
GLYPH *fg[256]; /* font glyphs */ |
24 |
short mwidth, mheight; /* mean glyph width and height */ |
25 |
char *name; /* font file name */ |
26 |
struct font *next; /* next font in list */ |
27 |
} FONT; |
28 |
|
29 |
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 |
|
39 |
#ifdef __cplusplus |
40 |
} |
41 |
#endif |
42 |
#endif /* _RAD_FONT_H_ */ |
43 |
|