4 #include <freetype/ftoutln.h>
5 #include <freetype/ttnameid.h>
7 #define CACHED_METRICS 0x10
8 #define CACHED_BITMAP 0x01
9 #define CACHED_PIXMAP 0x02
11 #define TTF_STYLE_NORMAL 0x00
12 #define TTF_STYLE_BOLD 0x01
13 #define TTF_STYLE_ITALIC 0x02
14 #define TTF_STYLE_UNDERLINE 0x04
16 /* Handy routines for converting from fixed point */
17 #define FT_FLOOR(X) ((X & -64) / 64)
18 #define FT_CEIL(X) (((X + 63) & -64) / 64)
20 /* Cached glyph information */
21 typedef struct cached_glyph
{
32 unsigned short cached
;
36 /* Freetype2 maintains all sorts of useful info itself */
39 /* We'll cache these ourselves */
48 /* Extra width in glyph bounds for text styles */
52 /* Information in the font for underlining */
56 /* Cache for style-transformed glyphs */
62 typedef struct _TTF_Font TTF_Font
;
70 void text_render(struct fbspl_theme
*theme
, struct text
*ct
, rect
*re
, u8
*target
);
71 void text_prerender(struct fbspl_theme
*theme
, struct text
*ct
, bool force
);
72 void text_bnd(struct fbspl_theme
*theme
, struct text
*ct
, rect
*bnd
);
74 int load_fonts(struct fbspl_theme
*theme
);
75 int free_fonts(struct fbspl_theme
*theme
);