1#
2# Create span
3#
4style = lv.style_t()
5style.init()
6style.set_border_width(1)
7style.set_border_color(lv.palette_main(lv.PALETTE.ORANGE))
8style.set_pad_all(2)
9
10spans = lv.spangroup(lv.scr_act())
11spans.set_width(300)
12spans.set_height(300)
13spans.center()
14spans.add_style(style, 0)
15
16spans.set_align(lv.TEXT_ALIGN.LEFT)
17spans.set_overflow(lv.SPAN_OVERFLOW.CLIP)
18spans.set_indent(20)
19spans.set_mode(lv.SPAN_MODE.BREAK)
20
21span = spans.new_span()
22span.set_text("china is a beautiful country.")
23span.style.set_text_color(lv.palette_main(lv.PALETTE.RED))
24span.style.set_text_decor(lv.TEXT_DECOR.STRIKETHROUGH | lv.TEXT_DECOR.UNDERLINE)
25span.style.set_text_opa(lv.OPA._30)
26
27span = spans.new_span()
28span.set_text_static("good good study, day day up.")
29#if LV_FONT_MONTSERRAT_24
30#    lv_style_set_text_font(&span->style,  &lv_font_montserrat_24);
31#endif
32span.style.set_text_color(lv.palette_main(lv.PALETTE.GREEN))
33
34span = spans.new_span()
35span.set_text_static("LVGL is an open-source graphics library.")
36span.style.set_text_color(lv.palette_main(lv.PALETTE.BLUE))
37
38span = spans.new_span()
39span.set_text_static("the boy no name.")
40span.style.set_text_color(lv.palette_main(lv.PALETTE.GREEN))
41#if LV_FONT_MONTSERRAT_20
42#    lv_style_set_text_font(&span->style, &lv_font_montserrat_20);
43#endif
44span.style.set_text_decor(lv.TEXT_DECOR.UNDERLINE)
45
46span = spans.new_span()
47span.set_text("I have a dream that hope to come true.")
48
49spans.refr_mode()
50
51# lv_span_del(spans, span);
52# lv_obj_del(spans);
53
54