26 lines
1.0 KiB
Markdown
26 lines
1.0 KiB
Markdown
# Fonts
|
|
|
|
Generated with https://lvgl.io/tools/fontconverter. Your best bet is finding a .tff file from google fonts. Using compression on a .c file appears to have issues.
|
|
|
|
|
|
|
|
Adding a custom font to the binary:
|
|
|
|
highlevel
|
|
- Create `lv_font_my_26.c` using tool above
|
|
- add font to lvgl/src/font submodule
|
|
- update lv_conf.h with `#define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(lv_font_my_26)` If needed you can turn off montserrat fonts, and set a new default font.
|
|
- Build and import using `lv.font_my_26`
|
|
|
|
|
|
Example lv_conf.h
|
|
```
|
|
/*Optionally declare custom fonts here.
|
|
*You can use these fonts as default font too and they will be available globally.
|
|
*E.g. #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(my_font_1) LV_FONT_DECLARE(my_font_2)*/
|
|
#define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(lv_font_inter_16) LV_FONT_DECLARE(lv_font_inter_20) LV_FONT_DECLARE(lv_font_inter_28) LV_FONT_DECLARE(lv_font_inter_36)
|
|
|
|
/*Always set a default font*/
|
|
// #define LV_FONT_DEFAULT &lv_font_montserrat_14
|
|
#define LV_FONT_DEFAULT &lv_font_inter_16
|
|
``` |