diff --git a/examples/widgets/keyboard/lv_example_keyboard_1.c b/examples/widgets/keyboard/lv_example_keyboard_1.c index 91c0eae4b..ba4bc0727 100644 --- a/examples/widgets/keyboard/lv_example_keyboard_1.c +++ b/examples/widgets/keyboard/lv_example_keyboard_1.c @@ -23,18 +23,26 @@ void lv_example_keyboard_1(void) lv_obj_t * kb = lv_keyboard_create(lv_screen_active()); /*Create a text area. The keyboard will write here*/ - lv_obj_t * ta; - ta = lv_textarea_create(lv_screen_active()); - lv_obj_align(ta, LV_ALIGN_TOP_LEFT, 10, 10); - lv_obj_add_event_cb(ta, ta_event_cb, LV_EVENT_ALL, kb); - lv_textarea_set_placeholder_text(ta, "Hello"); - lv_obj_set_size(ta, 140, 80); + lv_obj_t * ta1; + ta1 = lv_textarea_create(lv_screen_active()); + lv_obj_align(ta1, LV_ALIGN_TOP_LEFT, 10, 10); + lv_obj_add_event_cb(ta1, ta_event_cb, LV_EVENT_ALL, kb); + lv_textarea_set_placeholder_text(ta1, "Hello"); + lv_obj_set_size(ta1, 140, 80); - ta = lv_textarea_create(lv_screen_active()); - lv_obj_align(ta, LV_ALIGN_TOP_RIGHT, -10, 10); - lv_obj_add_event_cb(ta, ta_event_cb, LV_EVENT_ALL, kb); - lv_obj_set_size(ta, 140, 80); + lv_obj_t * ta2; + ta2 = lv_textarea_create(lv_screen_active()); + lv_obj_align(ta2, LV_ALIGN_TOP_RIGHT, -10, 10); + lv_obj_add_event_cb(ta2, ta_event_cb, LV_EVENT_ALL, kb); + lv_obj_set_size(ta2, 140, 80); - lv_keyboard_set_textarea(kb, ta); + lv_keyboard_set_textarea(kb, ta1); + + /*The keyboard will show Arabic characters if they are enabled */ +#if LV_USE_ARABIC_PERSIAN_CHARS && LV_FONT_DEJAVU_16_PERSIAN_HEBREW + lv_obj_set_style_text_font(kb, &lv_font_dejavu_16_persian_hebrew, 0); + lv_obj_set_style_text_font(ta1, &lv_font_dejavu_16_persian_hebrew, 0); + lv_obj_set_style_text_font(ta2, &lv_font_dejavu_16_persian_hebrew, 0); +#endif } #endif diff --git a/examples/widgets/textarea/lv_example_textarea_2.c b/examples/widgets/textarea/lv_example_textarea_2.c index 53f1e3b8d..b1d7cbc8c 100644 --- a/examples/widgets/textarea/lv_example_textarea_2.c +++ b/examples/widgets/textarea/lv_example_textarea_2.c @@ -39,6 +39,14 @@ void lv_example_textarea_2(void) lv_obj_set_size(kb, LV_HOR_RES, LV_VER_RES / 2); lv_keyboard_set_textarea(kb, pwd_ta); /*Focus it on one of the text areas to start*/ + + /*The keyboard will show Arabic characters if they are enabled */ +#if LV_USE_ARABIC_PERSIAN_CHARS && LV_FONT_DEJAVU_16_PERSIAN_HEBREW + lv_obj_set_style_text_font(kb, &lv_font_dejavu_16_persian_hebrew, 0); + lv_obj_set_style_text_font(text_ta, &lv_font_dejavu_16_persian_hebrew, 0); + lv_obj_set_style_text_font(pwd_ta, &lv_font_dejavu_16_persian_hebrew, 0); +#endif + } static void ta_event_cb(lv_event_t * e) diff --git a/src/widgets/keyboard/lv_keyboard.c b/src/widgets/keyboard/lv_keyboard.c index ea12d8e04..3d6240d1b 100644 --- a/src/widgets/keyboard/lv_keyboard.c +++ b/src/widgets/keyboard/lv_keyboard.c @@ -90,6 +90,7 @@ static const lv_buttonmatrix_ctrl_t default_kb_ctrl_uc_map[] = { #endif LV_BUTTONMATRIX_CTRL_CHECKED | 2, 6, LV_BUTTONMATRIX_CTRL_CHECKED | 2, LV_KEYBOARD_CTRL_BUTTON_FLAGS | 2 }; + #if LV_USE_ARABIC_PERSIAN_CHARS == 1 static const char * const default_kb_map_ar[] = { "1#", "ض", "ص", "ث", "ق", "ف", "غ", "ع", "ه", "خ", "ح", "ج", "\n",