From 8361d89a55a9f8c5e78b802e594fc3168e7f2eaa Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Sat, 21 Nov 2020 23:49:37 +0100 Subject: [PATCH] fix(arabic): support processing again alraedy processed texts with _lv_txt_ap_proc --- CHANGELOG.md | 1 + src/lv_misc/lv_txt_ap.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 23431e2df..bf0abdcc7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ ### Bugfixes - fix(btnmatrix) handle arabic texts in button matrices - fix(indev) disabled object shouldn't absorb clicks but let the parent to be clicked +- fix(arabic) support processing again already processed texts with _lv_txt_ap_proc ## v7.7.2 (Planned to 17.11.2020) ### Bugfixes diff --git a/src/lv_misc/lv_txt_ap.c b/src/lv_misc/lv_txt_ap.c index 727a0dcef..4c68a2773 100644 --- a/src/lv_misc/lv_txt_ap.c +++ b/src/lv_misc/lv_txt_ap.c @@ -211,6 +211,13 @@ static uint32_t lv_ap_get_char_index(uint16_t c) for(uint8_t i = 0; ap_chars_map[i].char_end_form; i++) { if(c == (ap_chars_map[i].char_offset + LV_AP_ALPHABET_BASE_CODE)) return i; + else if (c == ap_chars_map[i].char_end_form //is it an End form + || c == (ap_chars_map[i].char_end_form + ap_chars_map[i].char_begining_form_offset) //is it a Begining form + || c == (ap_chars_map[i].char_end_form + ap_chars_map[i].char_middle_form_offset) //is it a middle form + || c == (ap_chars_map[i].char_end_form + ap_chars_map[i].char_isolated_form_offset)) //is it an isolated form + { + return i; + } } return LV_UNDEF_ARABIC_PERSIAN_CHARS; }