5 // I don't want to needlessly include <SDL_ttf.h> in every file that
6 // includes this one so this forward declaration makes those modules
7 // that don't what a TTF_Font is shut up about InitChars(); however
8 // technically TTF_Font is a typedef, so if the including file knows
9 // the real declaration, it would bawk at this.
10 #ifndef SDL_TTF_VERSION
14 #define NUM_FONT_LETTERS 256
15 #define NUM_LETTERS_RENDERED 128
16 #define FONT_DEFAULT_SPACING 5
24 bool InitChars(TTF_Font
*font
, uint32_t color
);
25 bool InitCharsShadowed(TTF_Font
*top
, uint32_t color
, uint32_t shadowcolor
);
27 bool InitBitmapChars(SDL_Surface
*sheet
, uint32_t fgcolor
, uint32_t color
);
28 bool InitBitmapCharsShadowed(SDL_Surface
*sheet
, uint32_t fgcolor
, uint32_t color
, uint32_t shadowcolor
);
32 SDL_Surface
*letters
[NUM_FONT_LETTERS
];
35 void ReplaceColor(SDL_Surface
*sfc
, uint32_t oldcolor
, uint32_t newcolor
);
39 extern NXFont whitefont
;
40 extern NXFont greenfont
;
41 extern NXFont bluefont
; // used for "F3:Options" text on pause screen
42 extern NXFont shadowfont
; // white letters w/ drop shadow
44 int font_draw(int x
, int y
, const char *text
, int spacing
=0, NXFont
*font
=&whitefont
);
45 int font_draw_shaded(int x
, int y
, const char *text
, int spacing
=0, NXFont
*font
=&whitefont
);
47 int GetFontWidth(const char *text
, int spacing
=0, bool is_shaded
=false);