lv_text_ap.h

API reference for lv_text_ap.h

Report on GitHub

Functions

lv_text_ap_strlen

Calculate the number of bytes required to store the Arabic/Persian processed version of a UTF-8 string, excluding the null terminator. Analogous to strlen() but accounts for character form substitutions (e.g. initial, medial, final, isolated forms).

 
size_t lv_text_ap_strlen(const char *txt)
Parameters
NameTypeDescription
txtconst char *Null-terminated UTF-8 input string. Must not be NULL.

Returns: size_t — Number of bytes in the processed output, excluding '\0'. Allocate (lv_text_ap_strlen(txt) + 1) bytes for the output buffer.

lv_text_ap_proc

Process a UTF-8 string and replace Arabic/Persian characters with their correct contextual forms (isolated, initial, medial, final) based on their position within each word.

The output buffer must be pre-allocated with at least (lv_text_ap_strlen(txt) + 1) bytes.

Returns early if txt or txt_out are null

 
void lv_text_ap_proc(const char *txt, char *txt_out)
Parameters
NameTypeDescription
txtconst char *Null-terminated UTF-8 input string.
txt_outchar *Output buffer to write the processed UTF-8 string into. Must not overlap with txt.

Non-Arabic/Persian characters are copied to the output unchanged.

Macros

LV_UNDEF_ARABIC_PERSIAN_CHARS

 
#define LV_UNDEF_ARABIC_PERSIAN_CHARS (UINT32_MAX)

LV_AP_ALPHABET_BASE_CODE

 
#define LV_AP_ALPHABET_BASE_CODE 0x0622

LV_AP_END_CHARS_LIST

 
#define LV_AP_END_CHARS_LIST {0,0,0,0,0,{0,0}}

Dependencies

How is this guide?

Last updated on

On this page