1 /************************************************************************
2 * SFONT - SDL Font Library by Karl Bartel <karlb@gmx.net> *
4 * All functions are explained below. There are two versions of each *
5 * funtction. The first is the normal one, the function with the *
6 * 2 at the end can be used when you want to handle more than one font *
9 ************************************************************************/
17 // Delcare one variable of this type for each font you are using.
18 // To load the fonts, load the font image into YourFont->Surface
19 // and call InitFont( YourFont );
26 // Initializes the font
27 // Font: this contains the suface with the font.
28 // The font must be loaded before using this function.
29 void InitFont (SDL_Surface *Font);
30 void InitFont2(SFont_FontInfo *Font);
32 // Blits a string to a surface
33 // Destination: the suface you want to blit to
34 // text: a string containing the text you want to blit.
35 void PutString (SDL_Surface *Surface, int x, int y, char *text);
36 void PutString2(SDL_Surface *Surface, SFont_FontInfo *Font, int x, int y, char *text);
38 // Returns the width of "text" in pixels
40 int SFont_TextWidth(char *text);
41 int SFont_TextWidth2(SFont_FontInfo *Font, char *text);
43 int TextWidth(char *text);
44 int TextWidth2(SFont_FontInfo *Font, char *text);
47 // Blits a string to with centered x position
48 void XCenteredString (SDL_Surface *Surface, int y, char *text);
49 void XCenteredString2(SDL_Surface *Surface, SFont_FontInfo *Font, int y, char *text);
51 // Allows the user to enter text
52 // Width: What is the maximum width of the text (in pixels)
53 // text: This string contains the text which was entered by the user
54 void SFont_Input ( SDL_Surface *Destination, int x, int y, int Width, char *text);
55 void SFont_Input2( SDL_Surface *Destination, SFont_FontInfo *Font, int x, int y, int Width, char *text);