mirror of
https://github.com/lvgl/lvgl.git
synced 2026-06-01 00:51:49 +08:00
feat(span): support bidi for span (#7717)
Signed-off-by: liuhongchao <liuhongchao@xiaomi.com>
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 3.8 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.9 KiB |
@@ -498,4 +498,23 @@ void test_spangroup_set_right_align_on_overflow(void)
|
||||
TEST_ASSERT_EQUAL_SCREENSHOT("widgets/span_10.png");
|
||||
}
|
||||
|
||||
void test_spangroup_rtl_mode(void)
|
||||
{
|
||||
const char * message = "مرحبا بكم في LVGL.";
|
||||
|
||||
active_screen = lv_screen_active();
|
||||
spangroup = lv_spangroup_create(active_screen);
|
||||
|
||||
lv_obj_set_style_outline_width(spangroup, 1, 0);
|
||||
lv_obj_set_style_text_font(spangroup, &lv_font_dejavu_16_persian_hebrew, 0);
|
||||
lv_obj_set_style_base_dir(spangroup, LV_BASE_DIR_RTL, 0);
|
||||
lv_obj_set_size(spangroup, 300, lv_font_dejavu_16_persian_hebrew.line_height);
|
||||
lv_spangroup_set_align(spangroup, LV_TEXT_ALIGN_LEFT);
|
||||
|
||||
lv_span_t * span = lv_spangroup_new_span(spangroup);
|
||||
lv_span_set_text_static(span, message);
|
||||
|
||||
TEST_ASSERT_EQUAL_SCREENSHOT("widgets/span_11.png");
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user