Functions

void hal_gfx_bind_font (hal_gfx_font_t *font)
 Bind the font to use in future hal_gfx_print() calls. More...
 
int hal_gfx_string_get_bbox (const char *str, int *w, int *h, int max_w, uint32_t wrap)
 Get the bounding box's width and height of a string. More...
 
void hal_gfx_print (const char *str, int x, int y, int w, int h, uint32_t fg_col, uint32_t align)
 Print pre-formatted text. More...
 
void hal_gfx_print_to_position (const char *str, int *pos_x, int *pos_y, int x, int y, int w, int h, uint32_t fg_col, uint32_t align)
 Print pre-formatted text. More...
 

Detailed Description

Function Documentation

◆ hal_gfx_bind_font()

void hal_gfx_bind_font ( hal_gfx_font_t font)

Bind the font to use in future hal_gfx_print() calls.

Parameters
[in]fontPointer to font

◆ hal_gfx_print()

void hal_gfx_print ( const char *  str,
int  x,
int  y,
int  w,
int  h,
uint32_t  fg_col,
uint32_t  align 
)

Print pre-formatted text.

Parameters
[in]strPointer to string
[in]xX coordinate of text-area's top-left corner
[in]yY coordinate of text-area's top-left corner
[in]wWidth of the text area
[in]hHeight of the text area
[in]fg_colForeground color of text
[in]alignAlignment and wrapping mode
Returns

◆ hal_gfx_print_to_position()

void hal_gfx_print_to_position ( const char *  str,
int *  pos_x,
int *  pos_y,
int  x,
int  y,
int  w,
int  h,
uint32_t  fg_col,
uint32_t  align 
)

Print pre-formatted text.

Parameters
[in]strPointer to string
[in]pos_xX position of next character to be drawn. Usually initialized to 0 by the user and then updated internally by the library
[in]pos_yY position of next character to be drawn. Usually initialized to 0 by the user and then updated internally by the library
[in]xX coordinate of text-area's top-left corner
[in]yY coordinate of text-area's top-left corner
[in]wWidth of the text area
[in]hHeight of the text area
[in]fg_colForeground color of text
[in]alignAlignment and wrapping mode
Returns

◆ hal_gfx_string_get_bbox()

int hal_gfx_string_get_bbox ( const char *  str,
int *  w,
int *  h,
int  max_w,
uint32_t  wrap 
)

Get the bounding box's width and height of a string.

Parameters
[in]strPointer to string
[in]wPointer to variable where width should be written
[in]hPointer to variable where height should be written
[in]max_wMax allowed width
[in]wrapwarp mode
Returns
Number of carriage returns