lv_text_private.h

API reference for lv_text_private.h

Report on GitHub
See Also: Public APIThis is the private implementation. See the public header for the stable interface.lv_text.h

Functions

lv_text_set_text_vfmt

Return a new formatted text. Memory will be allocated to store the text.

 
char * lv_text_set_text_vfmt(const char *fmt, va_list ap)
Parameters
NameTypeDescription
fmtconst char *printf-like format
apva_listitems to print

Returns: char * — pointer to the allocated text string.

Enums

lv_text_cmd_state_t

State machine for text renderer.

NameDescription
LV_TEXT_CMD_STATE_WAITWaiting for command
LV_TEXT_CMD_STATE_PARProcessing the parameter
LV_TEXT_CMD_STATE_INProcessing the command
Used by 1 function
  • lv_text_is_cmd — param state

Structs

struct

lv_text_attributes_t

MemberTypeDescription
letter_spaceint32_tLetter space between letters
line_spaceint32_tSpace between lines of text
max_widthint32_tMax width of the text (break the lines to fit this size). Set COORD_MAX to avoid
text_flagslv_text_flag_t
Used by 4 functions
  • lv_text_attributes_init — param attributes
  • lv_text_get_size_attributes — param attributes
  • lv_text_get_width — param attributes
  • lv_text_get_next_line — param attributes

Macros

LV_TXT_ENC_UTF8

 
#define LV_TXT_ENC_UTF8 1

LV_TXT_ENC_ASCII

 
#define LV_TXT_ENC_ASCII 2

LV_TEXT_LEN_MAX

 
#define LV_TEXT_LEN_MAX UINT32_MAX

Variables

lv_text_encoded_size

 
uint8_t(*const lv_text_encoded_size

Give the size of an encoded character

lv_text_unicode_to_encoded

 
uint32_t(*const lv_text_unicode_to_encoded

Convert a Unicode letter to encoded

lv_text_encoded_conv_wc

 
uint32_t(*const lv_text_encoded_conv_wc

Convert a wide character, e.g. 'Á' little endian to be compatible with the encoded format.

lv_text_encoded_next

 
uint32_t(*const lv_text_encoded_next

Decode the next encoded character from a string.

lv_text_encoded_prev

 
uint32_t(*const lv_text_encoded_prev

Get the previous encoded character form a string.

lv_text_encoded_get_byte_id

 
uint32_t(*const lv_text_encoded_get_byte_id

Convert a letter index (in the encoded text) to byte index. E.g. in UTF-8 "AÁRT" index of 'R' is 2 but start at byte 3 because 'Á' is 2 bytes long

lv_text_encoded_get_char_id

 
uint32_t(*const lv_text_encoded_get_char_id

Convert a byte index (in an encoded text) to character index. E.g. in UTF-8 "AÁRT" index of 'R' is 2 but start at byte 3 because 'Á' is 2 bytes long

lv_text_get_encoded_length

 
uint32_t(*const lv_text_get_encoded_length

Get the number of characters (and NOT bytes) in a string. E.g. in UTF-8 "ÁBC" is 3 characters (but 4 bytes)

Dependencies

How is this guide?

Last updated on

On this page