ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/font.h
Revision: 2.10
Committed: Wed Feb 2 00:01:48 2022 UTC (2 years, 3 months ago) by greg
Content type: text/plain
Branch: MAIN
CVS Tags: rad5R4, HEAD
Changes since 2.9: +3 -2 lines
Log Message:
feat: added maximum # glyph vertices for font

File Contents

# User Rev Content
1 greg 2.10 /* RCSid $Id: font.h,v 2.9 2021/11/20 00:40:33 greg 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 greg 2.8
8 schorsch 2.6 #ifdef __cplusplus
9     extern "C" {
10     #endif
11 greg 2.4
12 greg 2.1 typedef unsigned char GORD;
13    
14     typedef struct {
15     short nverts; /* number of vertices */
16 greg 2.2 GORD left, right, top, bottom; /* glyph extent */
17 greg 2.1 /* followed by vertex list */
18     } GLYPH;
19    
20     #define gvlist(g) ((GORD *)((g)+1))
21    
22     typedef struct font {
23 greg 2.9 char name[64]; /* font file name */
24     struct font *next; /* next font in list */
25 greg 2.10 unsigned short nref; /* number of references */
26 greg 2.9 short mwidth, mheight; /* mean glyph width and height */
27 greg 2.10 short maxgv; /* max # glyph vertices */
28 greg 2.1 GLYPH *fg[256]; /* font glyphs */
29     } FONT;
30    
31 greg 2.4 extern int retainfonts; /* retain loaded fonts? */
32    
33     extern FONT *getfont(char *fname);
34     extern void freefont(FONT *f);
35     extern int uniftext(short *sp, char *tp, FONT *f);
36     extern int squeeztext(short *sp, char *tp, FONT *f, int cis);
37     extern int proptext(short *sp, char *tp, FONT *f, int cis, int nsi);
38    
39 schorsch 2.6 #ifdef __cplusplus
40     }
41 greg 2.4 #endif
42 schorsch 2.6 #endif /* _RAD_FONT_H_ */
43