Jo Engine Simple ASCII Font & print support.
More...
Go to the source code of this file.
|
jo_font * | jo_font_load (const char *const sub_dir, const char *const filename, const jo_color transparent_color, const int letter_width, const int letter_height, const int letter_spacing, const char *const mapping) |
| Load a font. More...
|
|
void | jo_font_print (const jo_font *const font, int x, int y, float scale, char *str) |
| Print a string using a specific font (using top-left screen coordinates) More...
|
|
void | jo_font_print_centered (const jo_font *const font, int x, int y, float scale, char *str) |
| Print a string using a specific font (using screen center coordinates) More...
|
|
Jo Engine Simple ASCII Font & print support.
- Author
- Johannes Fetz
- Bug:
- Some glitch when changing scale in jo_font_printf_centered()
◆ jo_font
Data Fields |
char |
end_ascii |
|
char * |
lookup_table |
|
char |
spacing |
|
char |
start_ascii |
|
int |
z_index |
|
◆ jo_font_printf
#define jo_font_printf |
( |
|
F, |
|
|
|
X, |
|
|
|
Y, |
|
|
|
S, |
|
|
|
... |
|
) |
| |
Print arguments using a specific font (using top-left screen coordinates)
- Parameters
-
F | The font (returned by jo_font_load()) |
X | Horizontal location from the left border of the screen |
Y | Vertical location from the top border of the screen |
S | Font scale |
◆ jo_font_printf_centered
#define jo_font_printf_centered |
( |
|
F, |
|
|
|
X, |
|
|
|
Y, |
|
|
|
S, |
|
|
|
... |
|
) |
| |
Print arguments using a specific font (using screen center coordinates)
- Parameters
-
F | The font (returned by jo_font_load()) |
X | Horizontal location from the center of the screen |
Y | Vertical location from the center of the screen |
S | Font scale |
◆ jo_font_load()
jo_font* jo_font_load |
( |
const char *const |
sub_dir, |
|
|
const char *const |
filename, |
|
|
const jo_color |
transparent_color, |
|
|
const int |
letter_width, |
|
|
const int |
letter_height, |
|
|
const int |
letter_spacing, |
|
|
const char *const |
mapping |
|
) |
| |
Load a font.
- Parameters
-
sub_dir | Sub directory name (use JO_ROOT_DIR if the file is on the root directory) |
filename | Filename (upper case and shorter as possible like "FONT.TGA") |
transparent_color | Transparent color (see colors.h). Use JO_COLOR_Transparent by default |
letter_width | Letter width (must be a multiple of 8) |
letter_height | Letter height |
letter_spacing | Letter spacing |
mapping | Image pattern : "0123456789ABCDEFGH..." (use
to go to the next image line) |
- Returns
- Font object
◆ jo_font_print()
void jo_font_print |
( |
const jo_font *const |
font, |
|
|
int |
x, |
|
|
int |
y, |
|
|
float |
scale, |
|
|
char * |
str |
|
) |
| |
Print a string using a specific font (using top-left screen coordinates)
- Parameters
-
font | The font (returned by jo_font_load()) |
x | Horizontal location from the left border of the screen |
y | Vertical location from the top border of the screen |
scale | Font scale |
str | The string |
◆ jo_font_print_centered()
void jo_font_print_centered |
( |
const jo_font *const |
font, |
|
|
int |
x, |
|
|
int |
y, |
|
|
float |
scale, |
|
|
char * |
str |
|
) |
| |
Print a string using a specific font (using screen center coordinates)
- Parameters
-
font | The font (returned by jo_font_load()) |
x | Horizontal location from the center of the screen |
y | Vertical location from the center of the screen |
scale | Font scale |
str | The string |