mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-04-22 22:37:21 +00:00
lv_zifont
Interface to use a .zi V5 font at run time
.zi V5 font files
Obtain or create a font file:
- Download the HMI Font Pack from here
- Use Nextion Editor or USART Editor to generate a .zi font file
Add lv_zifont to your project
- Add library:
lv_lib_zifont
- Include
lv_zifont.h
in your project
Usage in LittlevGL
lv_zifont_init();
static lv_font_t font1;
lv_zifont_font_init(&font1, "./notosans_32.zi", 0);
static lv_style_t ft_style;
lv_style_copy(&ft_style, &lv_style_plain);
ft_style.text.font = &font1;
lv_obj_t * label = lv_label_create(lv_scr_act(), NULL);
lv_label_set_style(label, LV_LABEL_STYLE_MAIN, &ft_style);
lv_label_set_text(label, "Hello word");
Learn more
- ZI font format version 6 specification
- LittlevGL's font interface