4 // Original SFont code Copyright (C) Karl Bartel
5 // Copyright (C) 2005 David J. Goehrig <dgoehrig@cpan.org>
7 // ------------------------------------------------------------------------------
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU Lesser General Public
11 // License as published by the Free Software Foundation; either
12 // version 2.1 of the License, or (at your option) any later version.
14 // This library is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 // Lesser General Public License for more details.
19 // You should have received a copy of the GNU Lesser General Public
20 // License along with this library; if not, write to the Free Software
21 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 // ------------------------------------------------------------------------------
25 // Please feel free to send questions, suggestions or improvements to:
37 // Delcare one variable of this type for each font you are using.
38 // To load the fonts, load the font image into YourFont->Surface
39 // and call InitFont( YourFont );
46 // Initializes the font
47 // Font: this contains the suface with the font.
48 // The font must be loaded before using this function.
49 void InitFont (SDL_Surface *Font);
50 void InitFont2(SFont_FontInfo *Font);
52 // Blits a string to a surface
53 // Destination: the suface you want to blit to
54 // text: a string containing the text you want to blit.
55 void PutString (SDL_Surface *Surface, int x, int y, char *text);
56 void PutString2(SDL_Surface *Surface, SFont_FontInfo *Font, int x, int y, char *text);
58 // Returns the width of "text" in pixels
60 int SFont_TextWidth(char *text);
61 int SFont_TextWidth2(SFont_FontInfo *Font, char *text);
63 int TextWidth(char *text);
64 int TextWidth2(SFont_FontInfo *Font, char *text);
67 // Blits a string to with centered x position
68 void XCenteredString (SDL_Surface *Surface, int y, char *text);
69 void XCenteredString2(SDL_Surface *Surface, SFont_FontInfo *Font, int y, char *text);
71 // Allows the user to enter text
72 // Width: What is the maximum width of the text (in pixels)
73 // text: This string contains the text which was entered by the user
74 void SFont_Input ( SDL_Surface *Destination, int x, int y, int Width, char *text);
75 void SFont_Input2( SDL_Surface *Destination, SFont_FontInfo *Font, int x, int y, int Width, char *text);