acid-drop

- Hacking the planet from a LilyGo T-Deck using custom firmware
git clone git://git.acid.vegas/acid-drop.git
Log | Files | Refs | Archive | README | LICENSE

lv_example_span_1.py (1480B)

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