Back to index

radiance  4R0+20100331
font.h
Go to the documentation of this file.
00001 /* RCSid $Id: font.h,v 2.7 2003/06/27 06:53:21 greg Exp $ */
00002 /*
00003  * Header file for font handling routines
00004  */
00005 #ifndef _RAD_FONT_H_
00006 #define _RAD_FONT_H_
00007 #ifdef __cplusplus
00008 extern "C" {
00009 #endif
00010 
00011 typedef unsigned char  GORD;
00012 
00013 typedef struct {
00014        short  nverts;                     /* number of vertices */
00015        GORD  left, right, top, bottom;    /* glyph extent */
00016                                    /* followed by vertex list */
00017 }  GLYPH;
00018 
00019 #define gvlist(g)    ((GORD *)((g)+1))
00020 
00021 typedef struct font {
00022        int  nref;                  /* number of references */
00023        GLYPH  *fg[256];            /* font glyphs */
00024        short  mwidth, mheight;            /* mean glyph width and height */
00025        char  *name;                /* font file name */
00026        struct font  *next;         /* next font in list */
00027 }  FONT;
00028 
00029 extern int    retainfonts;         /* retain loaded fonts? */
00030 
00031 
00032 extern FONT  *getfont(char *fname);
00033 extern void  freefont(FONT *f);
00034 extern int  uniftext(short *sp, char *tp, FONT *f);
00035 extern int  squeeztext(short *sp, char *tp, FONT *f, int cis);
00036 extern int  proptext(short *sp, char *tp, FONT *f, int cis, int nsi);
00037 
00038 
00039 #ifdef __cplusplus
00040 }
00041 #endif
00042 #endif /* _RAD_FONT_H_ */
00043