font: use custom font

Created a new font file with icons for nakamochi.

Renamed font file to use generic filename that only includes size
information so that the code does not have to be changed if the
font is replaced with another font style.

Note: this font is not yet production ready, need to create a
test view in ngui to render and compare all icons side by side.
add-custom-font
OFF0 2 years ago
parent 7226c31dfb
commit 586b7716c2
Signed by: offbyn
GPG Key ID: 94A2F643C51F37FA

@ -45,8 +45,8 @@ pub fn build(b: *std.build.Builder) void {
ngui.addCSourceFiles(&.{
"src/ui/c/ui.c",
"src/ui/c/lv_font_courierprimecode_14.c",
"src/ui/c/lv_font_courierprimecode_16.c",
"src/ui/c/lv_font_courierprimecode_24.c",
"src/ui/c/lv_font_with_icons_16.c",
"src/ui/c/lv_font_with_icons_24.c",
}, ngui_cflags);
ngui.defineCMacroRaw(b.fmt("NM_DISP_HOR={}", .{disp_horiz}));

@ -346,11 +346,11 @@
/*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_courierprimecode_14) LV_FONT_DECLARE(lv_font_courierprimecode_16) LV_FONT_DECLARE(lv_font_courierprimecode_24)
#define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(lv_font_courierprimecode_14) LV_FONT_DECLARE(lv_font_with_icons_16) LV_FONT_DECLARE(lv_font_with_icons_24)
/*Always set a default font*/
//#define LV_FONT_DEFAULT &lv_font_montserrat_14
#define LV_FONT_DEFAULT &lv_font_courierprimecode_16
#define LV_FONT_DEFAULT &lv_font_with_icons_16
/* additional fontawesome symbols to complement LV_SYMBOL_xxx */
#define NM_SYMBOL_BITCOIN "\xEF\x8D\xB9" /* 0xF379 */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -276,7 +276,7 @@ extern int ui_init()
LV_FONT_DEFAULT);
lv_disp_set_theme(disp, theme);
font_large = &lv_font_courierprimecode_24; /* static */
font_large = &lv_font_with_icons_24; /* static */
lv_style_init(&style_title);
lv_style_set_text_font(&style_title, font_large);