This modules provides functionality for outputting a monochrome font to a display.
Modules | |
System font | |
The system font objects are globally available for a graphical application. | |
Data Structures | |
struct | font |
Storage structure for font meta data. More... | |
Enumerations | |
enum | font_data_type { FONT_LOC_PROGMEM } |
Valid storage locations for font data. More... | |
Strings and characters located in RAM | |
void | gfx_mono_draw_char (const char c, const gfx_coord_t x, const gfx_coord_t y, const struct font *font) |
Draws a character to the display. More... | |
void | gfx_mono_draw_string (const char *str, const gfx_coord_t x, const gfx_coord_t y, const struct font *font) |
Draws a string to the display. More... | |
void | gfx_mono_get_string_bounding_box (char const *str, const struct font *font, gfx_coord_t *width, gfx_coord_t *height) |
Computes the bounding box of a string. More... | |
Strings located in flash | |
void | gfx_mono_draw_progmem_string (char PROGMEM_PTR_T str, gfx_coord_t x, gfx_coord_t y, const struct font *font) |
Draws a string located in program memory to the display. More... | |
void | gfx_mono_get_progmem_string_bounding_box (char PROGMEM_PTR_T str, const struct font *font, gfx_coord_t *width, gfx_coord_t *height) |
Computes the bounding box of a string located in program memory. More... | |
enum font_data_type |
void gfx_mono_draw_char | ( | const char | c, |
const gfx_coord_t | x, | ||
const gfx_coord_t | y, | ||
const struct font * | font | ||
) |
Draws a character to the display.
[in] | c | Character to be drawn |
[in] | x | X coordinate on screen. |
[in] | y | Y coordinate on screen. |
[in] | font | Font to draw character in |
References Assert, FONT_LOC_PROGMEM, gfx_mono_draw_char_hugemem(), gfx_mono_draw_char_progmem(), gfx_mono_draw_filled_rect, GFX_PIXEL_CLR, font::height, font::type, and font::width.
Referenced by about_co_routine(), about_task(), gfx_mono_draw_progmem_string(), gfx_mono_draw_string(), terminal_co_routine(), and terminal_task().
void gfx_mono_draw_progmem_string | ( | char PROGMEM_PTR_T | str, |
gfx_coord_t | x, | ||
gfx_coord_t | y, | ||
const struct font * | font | ||
) |
Draws a string located in program memory to the display.
This function will draw a string located in program memory to the display, this differs from gfx_mono_draw_string() by using constant string data from the program memory instead of string data in RAM.
Using program memory for constant strings will reduce the applications need for RAM, and thus lower the overall size footprint.
[in] | str | Pointer to string located in program memory |
[in] | x | X coordinate on screen. |
[in] | y | Y coordinate on screen. |
[in] | font | Font to draw string in |
References Assert, gfx_mono_draw_char(), font::height, NULL, PROGMEM_PTR_T, PROGMEM_READ_BYTE, and font::width.
Referenced by gfx_mono_menu_init(), gfx_mono_spinctrl_draw(), and menu_draw().
void gfx_mono_draw_string | ( | const char * | str, |
gfx_coord_t | x, | ||
gfx_coord_t | y, | ||
const struct font * | font | ||
) |
Draws a string to the display.
This function will draw a string located in memory to the display.
[in] | str | Pointer to string |
[in] | x | X coordinate on screen. |
[in] | y | Y coordinate on screen. |
[in] | font | Font to draw string in |
References Assert, gfx_mono_draw_char(), font::height, NULL, and font::width.
Referenced by gfx_mono_spinctrl_draw(), gfx_mono_spinctrl_draw_button(), init_display(), main(), main_co_routine(), main_task(), and setup_board().
void gfx_mono_get_progmem_string_bounding_box | ( | char PROGMEM_PTR_T | str, |
const struct font * | font, | ||
gfx_coord_t * | width, | ||
gfx_coord_t * | height | ||
) |
Computes the bounding box of a string located in program memory.
[in] | str | String in program memory to calculate bounding box for |
[in] | font | Font used |
[in] | width | Pointer to width result |
[in] | height | Pointer to height result |
References Assert, font::height, NULL, PROGMEM_PTR_T, PROGMEM_READ_BYTE, and font::width.
void gfx_mono_get_string_bounding_box | ( | const char * | str, |
const struct font * | font, | ||
gfx_coord_t * | width, | ||
gfx_coord_t * | height | ||
) |
Computes the bounding box of a string.
[in] | str | String to calculate bounding box for |
[in] | font | Font used |
[in] | width | Pointer to width result |
[in] | height | Pointer to height result |
References Assert, font::height, NULL, and font::width.
Referenced by gfx_mono_spinctrl_draw_button().