GrafX2 2.9.3227
The ultimate 256-color painting program
|
Text rendering system, that uses bitmaps as fonts. More...
#include "gfx2surface.h"
Data Structures | |
struct | SFont_Font |
Declare one variable of this type for each font you are using. More... | |
Functions | |
SFont_Font * | SFont_InitFont (T_GFX2_Surface *Font) |
Initializes the font. More... | |
void | SFont_FreeFont (SFont_Font *Font) |
Frees the font. More... | |
void | SFont_Write (T_GFX2_Surface *Surface, const SFont_Font *Font, int x, int y, const char *text) |
Blits a string to a surface. More... | |
int | SFont_TextWidth (const SFont_Font *Font, const char *text) |
Returns the width of "text" in pixels. More... | |
int | SFont_TextHeight (const SFont_Font *Font, const char *text) |
Returns the height of "text" in pixels (which is always equal to Font->Surface->h) More... | |
Text rendering system, that uses bitmaps as fonts.
Not specific to Grafx2, it writes to SDL_Surface.
SFont_Font * SFont_InitFont | ( | T_GFX2_Surface * | Font | ) |
Initializes the font.
Font | this contains the suface with the font. The Surface must be loaded before calling this function |
References SFont_Font::CharBegin, SFont_Font::CharWidth, Get_GFX2_Surface_pixel(), T_GFX2_Surface::h, NULL, SFont_Font::Space, SFont_Font::Surface, and SFont_Font::Transparent.
Referenced by Render_text_SFont().
void SFont_FreeFont | ( | SFont_Font * | Font | ) |
Frees the font.
Font | The font to free The font must be loaded before using this function. |
References Free_GFX2_Surface(), and SFont_Font::Surface.
Referenced by Render_text_SFont().
void SFont_Write | ( | T_GFX2_Surface * | Surface, |
const SFont_Font * | Font, | ||
int | x, | ||
int | y, | ||
const char * | text | ||
) |
Blits a string to a surface.
Surface | The surface you want to blit to. |
Font | The font to use. |
text | A string containing the text you want to blit. |
x | Coordinates to start drawing. |
y | Coordinates to start drawing. |
References SFont_Font::CharBegin, SFont_Font::CharWidth, T_GFX2_Surface::h, NULL, T_GFX2_Surface::pixels, SFont_Font::Space, SFont_Font::Surface, and T_GFX2_Surface::w.
Referenced by Render_text_SFont().
int SFont_TextWidth | ( | const SFont_Font * | Font, |
const char * | text | ||
) |
Returns the width of "text" in pixels.
References SFont_Font::CharWidth, NULL, and SFont_Font::Space.
Referenced by Render_text_SFont().
int SFont_TextHeight | ( | const SFont_Font * | Font, |
const char * | text | ||
) |
Returns the height of "text" in pixels (which is always equal to Font->Surface->h)
References T_GFX2_Surface::h, and SFont_Font::Surface.
Referenced by Render_text_SFont().