font¶
struct font¶
-
struct
font
¶ Use bitmap fonts to draw text Bitmap fonts are made from images with a matrix of characters in ascii order.
create_font¶
destroy_font¶
load_font¶
-
int
load_font
(struct font *font, const char *filepath, int cols, int rows)¶ Build a font from a font image file containing 16x16 (256) characters
- Return
- -1 on error
- Parameters
font
-Font resource to generate
filepath
-font image to load
cols
-Number of columns in the font bitmap
rows
-Number of rows in the font bitmap
cleanup_font¶
draw_text¶
measure_text¶
-
void
measure_text
(struct font *font, const char *text, int *width, int *height)¶ Measure the expected width and height of some text using a font
- Parameters
font
-Font to use
text
-text to render
width
-a pointer to where the width will be stored
height
-a pointer to where the height will be stored