lv_bidi_private.h
API reference for lv_bidi_private.h
Functions
lv_bidi_get_logical_pos
Get the logical position of a character in a line
uint16_t lv_bidi_get_logical_pos(const char *str_in, char **bidi_txt, uint32_t len, lv_base_dir_t base_dir, uint32_t visual_pos, bool *is_rtl)| Name | Type | Description |
|---|---|---|
str_in | const char * | the input string. Can be only one line. |
bidi_txt | char ** | internally the text is bidi processed which buffer can be get here. If not required anymore has to freed with lv_free() Can be NULL is unused |
len | uint32_t | length of the line in character count |
base_dir | lv_base_dir_t | base direction of the text: LV_BASE_DIR_LTR or LV_BASE_DIR_RTL |
visual_pos | uint32_t | the visual character position which logical position should be get |
is_rtl | bool * | tell the char at visual_pos is RTL or LTR context |
Returns: uint16_t — the logical character position
lv_bidi_get_visual_pos
Get the visual position of a character in a line
uint16_t lv_bidi_get_visual_pos(const char *str_in, char **bidi_txt, uint16_t len, lv_base_dir_t base_dir, uint32_t logical_pos, bool *is_rtl)| Name | Type | Description |
|---|---|---|
str_in | const char * | the input string. Can be only one line. |
bidi_txt | char ** | internally the text is bidi processed which buffer can be get here. If not required anymore has to freed with lv_free() Can be NULL is unused |
len | uint16_t | length of the line in character count |
base_dir | lv_base_dir_t | base direction of the text: LV_BASE_DIR_LTR or LV_BASE_DIR_RTL |
logical_pos | uint32_t | the logical character position which visual position should be get |
is_rtl | bool * | tell the char at logical_pos is RTL or LTR context |
Returns: uint16_t — the visual character position
lv_bidi_process
Convert a text to get the characters in the correct visual order according to Unicode Bidirectional Algorithm
void lv_bidi_process(const char *str_in, char *str_out, lv_base_dir_t base_dir)| Name | Type | Description |
|---|---|---|
str_in | const char * | the text to process |
str_out | char * | store the result here. Has the be strlen(str_in) length |
base_dir | lv_base_dir_t | LV_BASE_DIR_LTR or LV_BASE_DIR_RTL |
lv_bidi_detect_base_dir
Auto-detect the base direction of a text by scanning all strong characters. RTL takes priority: if any RTL strong character is found, LV_BASE_DIR_RTL is returned immediately. Otherwise, LV_BASE_DIR_LTR is returned if any LTR strong character is found. If no strong character is present, falls back to LV_BIDI_BASE_DIR_DEF. When LV_BIDI_BASE_DIR_DEF is LV_BASE_DIR_AUTO, this function returns LV_BASE_DIR_LTR.
lv_base_dir_t lv_bidi_detect_base_dir(const char *txt)| Name | Type | Description |
|---|---|---|
txt | const char * | the text to process |
Returns: lv_base_dir_t — LV_BASE_DIR_LTR or LV_BASE_DIR_RTL
lv_bidi_process_paragraph
Bidi process a paragraph of text
void lv_bidi_process_paragraph(const char *str_in, char *str_out, uint32_t len, lv_base_dir_t base_dir, uint16_t *pos_conv_out, uint16_t pos_conv_len)| Name | Type | Description |
|---|---|---|
str_in | const char * | the string to process |
str_out | char * | store the result here |
len | uint32_t | length of the text |
base_dir | lv_base_dir_t | base dir of the text |
pos_conv_out | uint16_t * | an uint16_t array to store the related logical position of the character. Can be NULL is unused |
pos_conv_len | uint16_t | length of pos_conv_out in element count |
lv_bidi_calculate_align_internal
Internal implementation of lv_bidi_calculate_align
static void lv_bidi_calculate_align_internal(lv_text_align_t *align, lv_base_dir_t *base_dir, const char *txt)| Name | Type |
|---|---|
align | lv_text_align_t * |
base_dir | lv_base_dir_t * |
txt | const char * |
Dependencies
lvgl_public.h
Last updated on