Skip to content

Commit

Permalink
Fix examples to align to LVGL changes - 2
Browse files Browse the repository at this point in the history
  • Loading branch information
PGNetHun committed Jan 18, 2024
1 parent 01045cb commit f11cb89
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions examples/Dynamic_loading_font_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,22 @@
scr = lv.screen_active()
scr.clean()

myfont_cn = lv.binfont_load("S:%s/font/font-PHT-cn-20.bin" % script_path)
myfont_cn = lv.binfont_create("S:%s/font/font-PHT-cn-20.bin" % script_path)

label1 = lv.label(scr)
label1.set_style_text_font(myfont_cn, 0) # set the font
label1.set_text("上中下乎")
label1.align(lv.ALIGN.CENTER, 0, -25)

myfont_en = lv.binfont_load("S:%s/font/font-PHT-en-20.bin" % script_path)
myfont_en = lv.binfont_create("S:%s/font/font-PHT-en-20.bin" % script_path)

label2 = lv.label(scr)
label2.set_style_text_font(myfont_en, 0) # set the font
label2.set_text("Hello LVGL!")
label2.align(lv.ALIGN.CENTER, 0, 25)


myfont_jp= lv.binfont_load("S:%s/font/font-PHT-jp-20.bin" % script_path)
myfont_jp= lv.binfont_create("S:%s/font/font-PHT-jp-20.bin" % script_path)

label3 = lv.label(scr)
label3.set_style_text_font(myfont_jp, 0) # set the font
Expand Down
2 changes: 1 addition & 1 deletion examples/example1.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def init_gui(self):
image.align(lv.ALIGN.CENTER, 0, 0)
image_dsc = lv.image_dsc_t(
{
"header": {"w": 100, "h": 75, "cf": lv.COLOR_FORMAT.NATIVE},
"header": {"w": 100, "h": 75, "cf": lv.COLOR_FORMAT.ARGB8888},
"data_size": len(image_data),
"data": image_data,
}
Expand Down

0 comments on commit f11cb89

Please sign in to comment.