lv_text.h

Enums

enum lv_text_flag_t

Options for text rendering.

Values:

enumerator LV_TEXT_FLAG_NONE
enumerator LV_TEXT_FLAG_EXPAND
enumerator LV_TEXT_FLAG_FIT

Max-width is already equal to the longest line. (Used to skip some calculation)

enumerator LV_TEXT_FLAG_BREAK_ALL

To prevent overflow, insert breaks between any two characters. Otherwise breaks are inserted at word boundaries, as configured via LV_TXT_BREAK_CHARS or according to LV_TXT_LINE_BREAK_LONG_LEN, LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN, and LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN.

enumerator LV_TEXT_FLAG_RECOLOR

Enable parsing of recolor command

enum lv_text_align_t

Label align policy

Values:

enumerator LV_TEXT_ALIGN_AUTO

Align text auto

enumerator LV_TEXT_ALIGN_LEFT

Align text to left

enumerator LV_TEXT_ALIGN_CENTER

Align text to center

enumerator LV_TEXT_ALIGN_RIGHT

Align text to right

Functions

void lv_text_get_size(lv_point_t *size_res, const char *text, const lv_font_t *font, int32_t letter_space, int32_t line_space, int32_t max_width, lv_text_flag_t flag)

Get size of a text

Parameters:
  • size_res – pointer to a 'point_t' variable to store the result

  • text – pointer to a text

  • font – pointer to font of the text

  • letter_space – letter space of the text

  • line_space – line space of the text

  • max_width – max width of the text (break the lines to fit this size). Set COORD_MAX to avoid

  • flag – settings for the text from lv_text_flag_t