openHASP/lib/lv_lib_zifont
2020-04-28 11:37:11 +02:00
..
2020-01-24 19:33:41 +01:00
2020-04-28 11:37:11 +02:00
2020-04-02 13:07:34 +02:00
2020-01-24 19:33:41 +01: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