00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #include <SDL/SDL.h>
00014
00015
00016 struct SDLFont
00017 {
00018 SDL_Surface *font;
00019 int width;
00020 int charWidth;
00021 int *widths;
00022 unsigned char *data;
00023 };
00024
00025
00026
00027
00028 SDLFont *sdlFont_initFont(char *fontdir, float r, float g, float b, float a);
00029
00030
00031 inline SDLFont *sdlFont_initFont(char *fontdir, float r, float g, float b) { return initFont(fontdir, r,g,b,1); }
00032 inline SDLFont *sdlFont_initFont(char *fontdir) { return initFont(fontdir, 1,1,1,1); }
00033
00034
00035 void sdlFont_drawString(SDL_Surface *screen, SDLFont *font, int x, int y, char *str,...);
00036
00037
00038 int sdlFont_stringWidth(SDLFont *font, char *str,...);
00039
00040
00041 void sdlFont_freeFont(SDLFont *font);
00042