GrafX2 2.9.3227
The ultimate 256-color painting program
|
Functions related to rendering text as a brush, using TrueType or SFont. More...
Functions | |
void | Init_text (void) |
Initialization of text settings, needs to be called once on program startup. More... | |
void | Uninit_text (void) |
text settings cleanup. called on program shutdown More... | |
int | TrueType_is_supported (void) |
Returns true if text.c was compiled with TrueType support. More... | |
void | Add_font (const char *name) |
Add a new font to the list to propose to the user. More... | |
byte * | Render_text (const char *str, int font_number, int size, int antialias, int bold, int italic, int *width, int *height, T_Palette palette) |
Creates a brush, from the parameters given: More... | |
const char * | Font_label (int index) |
Finds a label to display for a font declared with Add_font(). More... | |
const char * | Font_name (int index) |
Finds the filename of a font declared with Add_font(). More... | |
int | TrueType_font (int index) |
Returns true if the font of this number is TrueType, false if it's a SFont bitmap. More... | |
int | Font_count (void) |
Number of fonts declared with a series of Add_font() More... | |
Functions related to rendering text as a brush, using TrueType or SFont.
void Init_text | ( | void | ) |
Initialization of text settings, needs to be called once on program startup.
References Add_font(), Config_directory, Data_directory, Filepath_append_to_dir(), font_list_start, FONTS_SUBDIRECTORY, For_each_file(), and NULL.
Referenced by Init_program().
void Uninit_text | ( | void | ) |
text settings cleanup. called on program shutdown
References font_list_start, T_Font::Name, T_Font::Next, and NULL.
Referenced by Program_shutdown().
int TrueType_is_supported | ( | void | ) |
Returns true if text.c was compiled with TrueType support.
Referenced by Button_Stats().
void Add_font | ( | const char * | name | ) |
Add a new font to the list to propose to the user.
byte * Render_text | ( | const char * | str, |
int | font_number, | ||
int | size, | ||
int | antialias, | ||
int | bold, | ||
int | italic, | ||
int * | width, | ||
int * | height, | ||
T_Palette | palette | ||
) |
Creates a brush, from the parameters given:
str | The text to render |
font_number | The index of the font to use. Pass 0 for the first font you declared with Add_font(), 1 for the second etc. |
size | The size in points (unused for bitmap fonts) |
antialias | Boolean, true to use antialiasing in TrueType |
bold | Boolean, true to use bold rendering in TrueType |
italic | Boolean, true to use italic rendering in TrueType |
width | Returns the width of the created brush, in pixels. |
height | Returns the height of the created brush, in pixels. |
palette | Returns the custom palette for the brush. Returns true on success. |
References font_list_start, T_Font::Is_truetype, T_Font::Next, NULL, Render_text_SFont(), and Render_text_TTF().
Referenced by Button_Text().
const char * Font_label | ( | int | index | ) |
Finds a label to display for a font declared with Add_font().
References font_list_start, T_Font::Label, T_Font::Next, and NULL.
Referenced by Draw_one_font_name().
const char * Font_name | ( | int | index | ) |
Finds the filename of a font declared with Add_font().
References font_list_start, T_Font::Name, T_Font::Next, and NULL.
Referenced by Render_text_SFont(), and Render_text_TTF().
int TrueType_font | ( | int | index | ) |
Returns true if the font of this number is TrueType, false if it's a SFont bitmap.
References font_list_start, T_Font::Is_truetype, T_Font::Next, and NULL.
Referenced by Button_Text().
int Font_count | ( | void | ) |
Number of fonts declared with a series of Add_font()
References font_list_start, T_Font::Next, and NULL.
Referenced by Button_Text().