1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-14 06:42:58 +08:00

fix(bidi): updated BIDI text support to include persian and arabic (#6105)

This commit is contained in:
Mattia Maldini 2024-04-28 12:12:27 +02:00 committed by GitHub
parent 1bd1b874a1
commit 416fa2a6ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -127,9 +127,16 @@ bool lv_bidi_letter_is_weak(uint32_t letter)
bool lv_bidi_letter_is_rtl(uint32_t letter) bool lv_bidi_letter_is_rtl(uint32_t letter)
{ {
if(letter >= 0x5d0 && letter <= 0x5ea) return true;
if(letter == 0x202E) return true; /*Unicode of LV_BIDI_RLO*/ if(letter == 0x202E) return true; /*Unicode of LV_BIDI_RLO*/
// if(letter >= 'a' && letter <= 'z') return true;
/*Check for Persian and Arabic characters [https://en.wikipedia.org/wiki/Arabic_script_in_Unicode]*/
if(letter >= 0x600 && letter <= 0x6FF) return true;
if(letter >= 0xFB50 && letter <= 0xFDFF) return true;
if(letter >= 0xFE70 && letter <= 0xFEFF) return true;
/*Check for Hebrew characters [https://en.wikipedia.org/wiki/Unicode_and_HTML_for_the_Hebrew_alphabet]*/
if(letter >= 0x590 && letter <= 0x5FF) return true;
if(letter >= 0xFB1D && letter <= 0xFB4F) return true;
return false; return false;
} }