mikroSDK Reference Manual
|
Text Writing API. More...
Functions list | |
void | gl_draw_char (char ch, gl_coord_t x, gl_coord_t y) |
Write a single character on a display. More... | |
void | gl_draw_text (const char *__generic text, gl_coord_t x, gl_coord_t y) |
Write a text on display. More... | |
gl_size_t | gl_get_text_dimensions (const char *__generic text) |
Calculate text dimension. More... | |
This API is used for writing and managing text on the display. Desired font must be generated by the resource manager from NECTO Studio.
void gl_draw_char | ( | char | ch, |
gl_coord_t | x, | ||
gl_coord_t | y | ||
) |
This function writes a single character on a display with top left pixel situated at given x
and y
coordinates. Character look depends on currently active font, pen, and orientation. Background color can also be specified. It is possible to rotate character using the gl_set_font_orientation. If the given character is written out of the display, the surplus will be cropped. Character that can be drawn is determined by the used font; if not supported by the font, it won't be printed and the behavior in that case is undefined. Character '\n' is not suported.
[in] | ch | Character to write. |
[in] | x | X coordinate. See gl_coord_t definition for detailed explanation. |
[in] | y | Y coordinate. See gl_coord_t definition for detailed explanation. |
Example
void gl_draw_text | ( | const char *__generic | text, |
gl_coord_t | x, | ||
gl_coord_t | y | ||
) |
This function writes a text on a display with top left pixel situated at given x
and y
coordinates using current font and pen. To write a text with background use gl_set_font_background and gl_set_font_background_color. It is possible to choose text orientation using the gl_set_font_orientation. If a given text is written out of the display, the surplus will be cropped. Character that can be drawn is determined by the used font; if not supported by the font, it won't be printed and the behavior in that case is undefined. Character '\n' is not suported. If text
is NULL nothing will be drawn.
[in] | text | Text to draw. |
[in] | x | X coordinate. See gl_coord_t definition for detailed explanation. |
[in] | y | Y coordinate. See gl_coord_t definition for detailed explanation. |
Example
gl_size_t gl_get_text_dimensions | ( | const char *__generic | text | ) |
This function calculates text dimension. The size of the text
depends on the font which has been set by gl_set_font.
[in] | text | Text to measure. |
text
if font is set, otherwise returns size = {0, 0}. See gl_size_t definition for detailed explanation. Example