lv_text_ap.h¶
Functions
-
size_t lv_text_ap_strlen(const char *txt)¶
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).
- Parameters:
txt – Null-terminated UTF-8 input string. Must not be NULL.
- Returns:
Number of bytes in the processed output, excluding '\0'. Allocate (lv_text_ap_strlen(txt) + 1) bytes for the output buffer.
-
void lv_text_ap_proc(const char *txt, char *txt_out)¶
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
txtortxt_outare nullNote
Non-Arabic/Persian characters are copied to the output unchanged.
- Parameters:
txt – Null-terminated UTF-8 input string.
txt_out – Output buffer to write the processed UTF-8 string into. Must not overlap with
txt.