|
maug
Quick and dirty C mini-augmentation library.
|
Tools for drawing strings using loadable fonts. More...
Files | |
| file | retrofnt.h |
Macros | |
| #define | RETROFONT_PRESENT 1 |
| Tell other modules that retrofont is loaded. | |
| #define | RETROFONT_LINE_SZ 80 |
| #define | RETROFONT_TRACE_LVL 0 |
| #define | RETROFONT_FLAG_OUTLINE 0x04 |
| Flag for retroflat_string() and retroflat_string_sz() to print text as outline-only. | |
| #define | RETROFONT_FLAG_SZ_MIN 0x08 |
| Flag for retroflat_string_sz() to return the size of the shortest line in a multi-line string. | |
Typedefs | |
| typedef MERROR_RETVAL(* | retrofont_try_platform_t) (struct RETROFONT *font, const char *sub_name, void *data) |
| Callback for platform-specific font substitute loader to attempt to use font substitute. | |
Functions | |
| MERROR_RETVAL | retrofont_load (const char *font_name, MAUG_MHANDLE *p_font_h, uint8_t glyph_h, uint16_t first_glyph, uint16_t glyphs_count) |
| Load a font for drawing. | |
| void | retrofont_string (retroflat_blit_t *target, RETROFLAT_COLOR color, const char *str, size_t str_sz, MAUG_MHANDLE font_h, size_t x, size_t y, size_t max_w, size_t max_h, uint8_t flags) |
| Draw a string with the given font. | |
| void | retrofont_string_indent (retroflat_blit_t *target, RETROFLAT_COLOR color, const char *str, size_t str_sz, MAUG_MHANDLE font_h, size_t x, size_t y, size_t max_w, size_t max_h, size_t x_iter, uint8_t flags) |
| MERROR_RETVAL | retrofont_string_sz (retroflat_blit_t *target, const char *str, size_t str_sz, MAUG_MHANDLE font_h, retroflat_pxxy_t max_w, retroflat_pxxy_t max_h, retroflat_pxxy_t *p_out_w, retroflat_pxxy_t *p_out_h, uint8_t flags) |
| void | retrofont_free (MAUG_MHANDLE *p_font_h) |
Tools for drawing strings using loadable fonts.
This API contains platform-specific parts present in MAUG_ROOT/api/font.
| #define RETROFONT_FLAG_OUTLINE 0x04 |
Flag for retroflat_string() and retroflat_string_sz() to print text as outline-only.
| MERROR_RETVAL retrofont_load | ( | const char * | font_name, |
| MAUG_MHANDLE * | p_font_h, | ||
| uint8_t | glyph_h, | ||
| uint16_t | first_glyph, | ||
| uint16_t | glyphs_count ) |
Load a font for drawing.
| font_name | Name of the font file to load. |
| p_font_h | Handle into which to load the font data. |
| glyph_h | Height of the font being loaded. |
| first_glyph | ASCII index of the first glyph to load from the font. |
| glyphs_count | Number of glyphs to load from the font. |
| void retrofont_string | ( | retroflat_blit_t * | target, |
| RETROFLAT_COLOR | color, | ||
| const char * | str, | ||
| size_t | str_sz, | ||
| MAUG_MHANDLE | font_h, | ||
| size_t | x, | ||
| size_t | y, | ||
| size_t | max_w, | ||
| size_t | max_h, | ||
| uint8_t | flags ) |
Draw a string with the given font.
| target | Bitmap, screen, or texture on which to draw string. |
| color | Color in which to draw string. |
| str | String to draw on-screen. |
| str_sz | Size of the string to draw in characters. |
| max_w | Width in pixels after which string should be wrapped. |
| max_h | Height in pixels after which string should be truncated. |