1 /* Header for FreeType 2 and UTF-8 encoding support for
5 #ifndef DP_FREETYPE2_H__
6 #define DP_FREETYPE2_H__
8 //#include <sys/types.h>
13 * From http://www.unicode.org/Public/UNIDATA/Blocks.txt
15 * E000..F8FF; Private Use Area
16 * F0000..FFFFF; Supplementary Private Use Area-A
20 * Contains the non-FreeType2 version of characters.
23 typedef struct ft2_font_map_s ft2_font_map_t;
24 typedef struct ft2_attachment_s ft2_attachment_t;
25 #define ft2_oldstyle_map ((ft2_font_map_t*)-1)
27 typedef float ft2_kernvec[2];
28 typedef struct ft2_kerning_s
30 ft2_kernvec kerning[256][256]; /* kerning[left char][right char] */
33 typedef struct ft2_font_s
39 // TODO: clean this up and do not expose everything.
41 //unsigned char *data;
42 //fs_offset_t datasize;
45 // an unordered array of ordered linked lists of glyph maps for a specific size
46 ft2_font_map_t *font_maps[MAX_FONT_SIZES];
50 size_t attachmentcount;
51 ft2_attachment_t *attachments;
54 void Font_CloseLibrary(void);
56 qboolean Font_OpenLibrary(void);
57 ft2_font_t* Font_Alloc(void);
58 void Font_UnloadFont(ft2_font_t *font);
59 //qboolean Font_LoadFont(const char *name, int size, int face, ft2_font_t *font);
60 int Font_IndexForSize(ft2_font_t *font, float size);
61 ft2_font_map_t *Font_MapForIndex(ft2_font_t *font, int index);
62 qboolean Font_LoadFont(const char *name, dp_font_t *dpfnt);
63 qboolean Font_GetKerningForSize(ft2_font_t *font, int size, Uchar left, Uchar right, float *outx, float *outy);
64 qboolean Font_GetKerningForMap(ft2_font_t *font, int map_index, Uchar left, Uchar right, float *outx, float *outy);
66 #endif // DP_FREETYPE2_H__