From e1cb4f64097a7d084f178f762546cecb5bd3c6be Mon Sep 17 00:00:00 2001 From: Michele Bini Date: Wed, 30 Mar 2022 22:36:09 +0200 Subject: only use neofont15 diff --git a/src/displayapp/LittleVgl.cpp b/src/displayapp/LittleVgl.cpp index 9dc4e2a..5e33d1e 100644 --- a/src/displayapp/LittleVgl.cpp +++ b/src/displayapp/LittleVgl.cpp @@ -186,7 +186,7 @@ bool LittleVgl::GetTouchPadInfo(lv_indev_data_t* ptr) { void LittleVgl::InitTheme() { lv_theme_t* th = lv_pinetime_theme_init( - LV_COLOR_WHITE, LV_COLOR_SILVER, 0, &neofont1, &neofont1, &neofont1, &neofont1); + LV_COLOR_WHITE, LV_COLOR_SILVER, 0, &neofont15, &neofont15, &neofont15, &neofont15); lv_theme_set_act(th); } diff --git a/src/displayapp/fonts/neofont.c b/src/displayapp/fonts/neofont.c index 00c1e8f..cfc8e72 100644 --- a/src/displayapp/fonts/neofont.c +++ b/src/displayapp/fonts/neofont.c @@ -6,9 +6,8 @@ #include -#include -#include -#include "neofont.h" +// #include +// #include #define G( \ a,b,c, \ @@ -310,27 +309,7 @@ static const uint8_t glyphs[][2] = { #undef _ #undef G -/* Get info about glyph of `unicode_letter` in `font` font. - * Store the result in `dsc_out`. - * The next letter (`unicode_letter_next`) might be used to calculate the width required by this glyph (kerning) - */ -static bool neofont0_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out, uint32_t unicode_letter, uint32_t unicode_letter_next) -{ - /*Your code here*/ - - /* Store the result. - * For example ... - */ - dsc_out->adv_w = 4; /*Horizontal space required by the glyph in [px]*/ - dsc_out->box_h = 5; /*Height of the bitmap in [px]*/ - dsc_out->box_w = 3; /*Width of the bitmap in [px]*/ - dsc_out->ofs_x = 0; /*X offset of the bitmap in [pf]*/ - dsc_out->ofs_y = 0; /*Y offset of the bitmap measured from the as line*/ - dsc_out->bpp = 1; /*Bits per pixel: 1/2/4/8*/ - - return true; /*true: glyph found; false: glyph was not found*/ -} - +// This could be inline to save a few bytes... /* Get the bitmap of `unicode_letter` from `font`. */ static const uint8_t * neofont0_glyph_bitmap_cb(const lv_font_t * font, uint32_t unicode_letter) { @@ -360,224 +339,8 @@ static const uint8_t * neofont0_glyph_bitmap_cb(const lv_font_t * font, uint32_t return glyphs[sizeof(glyphs)/sizeof(glyphs[0])-1]; } -lv_font_t neofont0 = { - .get_glyph_dsc = neofont0_glyph_dsc_cb, /*Set a callback to get info about gylphs*/ - .get_glyph_bitmap = neofont0_glyph_bitmap_cb, /*Set a callback to get bitmap of a glyp*/ - .line_height = 6, /*The real line height where any text fits*/ - .base_line = 1, /*Base line measured from the top of line_height*/ - .dsc = 0, /*Store any implementation specific data here*/ -#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0) - .subpx = LV_FONT_SUBPX_NONE, -#endif -#if LV_VERSION_CHECK(7, 4, 0) || LVGL_VERSION_MAJOR >= 8 - .underline_position = 0, - .underline_thickness = 0, -#endif - .user_data = 0 /*Optionally some extra user data*/ -}; - -static bool neofont1_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out, uint32_t unicode_letter, uint32_t unicode_letter_next) -{ - /*Your code here*/ - - /* Store the result. - * For example ... - */ - - // ######..###### - // ##::::..::##:: - // ######..::##:: - // ::::##..::##:: - // ######..::##:: - - // ######..######.. - // ######..######.. - // ##::::..::##::.. - // ##::::..::##::.. - // ######..::##::.. - // ######..::##::.. - // ::::##..::##::.. - // ::::##..::##::.. - // ######..::##::.. - // ######..::##::.. - - dsc_out->adv_w = 8; /*Horizontal space required by the glyph in [px]*/ - dsc_out->box_h = 10; /*Height of the bitmap in [px]*/ - dsc_out->box_w = 6; /*Width of the bitmap in [px]*/ - dsc_out->ofs_x = 1; /*X offset of the bitmap in [pf]*/ - dsc_out->ofs_y = -1; /*Y offset of the bitmap measured from the as line*/ - dsc_out->bpp = 1; /*Bits per pixel: 1/2/4/8*/ - - return true; /*true: glyph found; false: glyph was not found*/ -} - -#if 0 -/* Get the bitmap of `unicode_letter` from `font`. */ -static const uint8_t * neofont1_glyph_bitmap_cb(const lv_font_t * font, uint32_t unicode_letter) -{ - const uint8_t *u = neofont0_glyph_bitmap_cb(font, unicode_letter); - static uint8_t v[(10*10+7)/8]; - uint8_t u0 = u[0]; - uint8_t u1 = u[1]; - - // .. .. .. .. .2 .2 .1 .1 .0 .0 - // .9 .8 .7 .6 .5 .4 .3 .2 .1 .0 - // .. .. .. .. .2 .2 .1 .1 .0 .0 - // 19 18 17 16 15 14 13 12 11 10 - // .. .. .. .5 .5 .4 .4 .3 .3 .. - // 29 28 27 26 25 24 23 22 21 20 - // .. .. .. .5 .5 .4 .4 .3 .3 .. - // 39 38 37 36 35 34 33 32 31 30 - - // v[7] = 0x00; - - uint8_t a,b,c, d,e,f, g,h,i, j,k,l, m,n,o; - a = (u0>>7)&1; u0 <<= 1; - b = (u0>>7)&1; u0 <<= 1; - c = (u0>>7)&1; u0 <<= 1; - d = (u0>>7)&1; u0 <<= 1; - e = (u0>>7)&1; u0 <<= 1; - f = (u0>>7)&1; u0 <<= 1; - g = (u0>>7)&1; u0 <<= 1; - h = (u0>>7)&1; - i = (u1>>7)&1; u1 <<= 1; - j = (u1>>7)&1; u1 <<= 1; - k = (u1>>7)&1; u1 <<= 1; - l = (u1>>7)&1; u1 <<= 1; - m = (u1>>7)&1; u1 <<= 1; - n = (u1>>7)&1; u1 <<= 1; - o = (u1>>7)&1; - -#define P(a,b,c,d, e,f,g,h) ((a<<7)|(b<<6)|(c<<5)|(d<<4)|(e<<3)|(f<<2)|(g<<1)|h) - - v[0] = P(0,0,a,a,b,b,c,c); - v[1] = P(0,0,a,a,b,b,c,c); - v[2] = P(0,0,d,d,e,e,f,f); - v[3] = P(0,d,d,e,e,f,f,0); - v[4] = P(0,g,g,h,h,i,i,0); - v[5] = P(g,g,h,h,i,i,0,0); - v[6] = P(j,j,k,k,l,l,0,0); - v[7] = P(j,j,k,k,l,l,0,0); - v[8] = P(m,m,n,n,o,o,0,0); - v[9] = P(m,m,n,n,o,o,0,0); - -#undef P - - return v; /*Or NULL if not found*/ -} -#endif - -/* Get the bitmap of `unicode_letter` from `font`. */ -static const uint8_t * neofont1_glyph_bitmap_cb(const lv_font_t * font, uint32_t unicode_letter) -{ - const uint8_t *u = neofont0_glyph_bitmap_cb(font, unicode_letter); - static uint8_t v[8]; - uint8_t u0 = u[0]; - uint8_t u1 = u[1]; - - // .. .. .. .. .2 .2 .1 .1 .0 .0 - // .9 .8 .7 .6 .5 .4 .3 .2 .1 .0 - // .. .. .. .. .2 .2 .1 .1 .0 .0 - // 19 18 17 16 15 14 13 12 11 10 - // .. .. .. .5 .5 .4 .4 .3 .3 .. - // 29 28 27 26 25 24 23 22 21 20 - // .. .. .. .5 .5 .4 .4 .3 .3 .. - // 39 38 37 36 35 34 33 32 31 30 - - // v[7] = 0x00; - - uint8_t a,b,c, d,e,f, g,h,i, j,k,l, m,n,o; - a = (u0>>7)&1; u0 <<= 1; - b = (u0>>7)&1; u0 <<= 1; - c = (u0>>7)&1; u0 <<= 1; - d = (u0>>7)&1; u0 <<= 1; - e = (u0>>7)&1; u0 <<= 1; - f = (u0>>7)&1; u0 <<= 1; - g = (u0>>7)&1; u0 <<= 1; - h = (u0>>7)&1; - i = (u1>>7)&1; u1 <<= 1; - j = (u1>>7)&1; u1 <<= 1; - k = (u1>>7)&1; u1 <<= 1; - l = (u1>>7)&1; u1 <<= 1; - m = (u1>>7)&1; u1 <<= 1; - n = (u1>>7)&1; u1 <<= 1; - o = (u1>>7)&1; - -#define P(a,b,c,d, e,f,g,h) ((a<<7)|(b<<6)|(c<<5)|(d<<4)|(e<<3)|(f<<2)|(g<<1)|h) - - v[0] = P(a,a,b,b,c,c, - - a,a); - v[1] = P(b,b,c,c, - - d,d,e,e); - v[2] = P(f,f, - - d,d,e,e,f,f); - - v[3] = P(g,g,h,h,i,i, - - g,g); - v[4] = P(h,h,i,i, - - j,j,k,k); - v[5] = P(l,l, - - j,j,k,k,l,l); - - v[6] = P(m,m,n,n,o,o, - - m,m); - v[7] = P(n,n,o,o, - - 0,0,0,0); - -#undef P - - return v; /*Or NULL if not found*/ -} - -/*Describe the properties of a font*/ -lv_font_t neofont1 = { - .get_glyph_dsc = neofont1_glyph_dsc_cb, /*Set a callback to get info about gylphs*/ - .get_glyph_bitmap = neofont1_glyph_bitmap_cb, /*Set a callback to get bitmap of a glyp*/ - .line_height = 12, /*The real line height where any text fits*/ - .base_line = 2, /*Base line measured from the top of line_height*/ - .dsc = 0, /*Store any implementation specific data here*/ -#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0) - .subpx = LV_FONT_SUBPX_NONE, -#endif -#if LV_VERSION_CHECK(7, 4, 0) || LVGL_VERSION_MAJOR >= 8 - .underline_position = 0, - .underline_thickness = 0, -#endif - .user_data = 0 /*Optionally some extra user data*/ -}; - static bool neofont15_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out, uint32_t unicode_letter, uint32_t unicode_letter_next) { - /*Your code here*/ - - /* Store the result. - * For example ... - */ - - // ######..###### - // ##::::..::##:: - // ######..::##:: - // ::::##..::##:: - // ######..::##:: - - // ######..######.. - // ######..######.. - // ##::::..::##::.. - // ##::::..::##::.. - // ######..::##::.. - // ######..::##::.. - // ::::##..::##::.. - // ::::##..::##::.. - // ######..::##::.. - // ######..::##::.. dsc_out->adv_w = 12; /*Horizontal space required by the glyph in [px]*/ dsc_out->box_h = 15; /*Height of the bitmap in [px]*/ @@ -589,7 +352,6 @@ static bool neofont15_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_t * return true; /*true: glyph found; false: glyph was not found*/ } - /* Get the bitmap of `unicode_letter` from `font`. */ static const uint8_t * neofont15_glyph_bitmap_cb(const lv_font_t * font, uint32_t unicode_letter) { @@ -598,17 +360,6 @@ static const uint8_t * neofont15_glyph_bitmap_cb(const lv_font_t * font, uint32_ uint8_t u0 = u[0]; uint8_t u1 = u[1]; - // .. .. .. .. .2 .2 .1 .1 .0 .0 - // .9 .8 .7 .6 .5 .4 .3 .2 .1 .0 - // .. .. .. .. .2 .2 .1 .1 .0 .0 - // 19 18 17 16 15 14 13 12 11 10 - // .. .. .. .5 .5 .4 .4 .3 .3 .. - // 29 28 27 26 25 24 23 22 21 20 - // .. .. .. .5 .5 .4 .4 .3 .3 .. - // 39 38 37 36 35 34 33 32 31 30 - - // v[7] = 0x00; - uint8_t a,b,c, d,e,f, g,h,i, j,k,l, m,n,o; a = (u0>>7)&1; u0 <<= 1; b = (u0>>7)&1; u0 <<= 1; @@ -669,7 +420,7 @@ static const uint8_t * neofont15_glyph_bitmap_cb(const lv_font_t * font, uint32_ } /*Describe the properties of a font*/ -lv_font_t neofont15 = { +const lv_font_t neofont15 = { .get_glyph_dsc = neofont15_glyph_dsc_cb, /*Set a callback to get info about gylphs*/ .get_glyph_bitmap = neofont15_glyph_bitmap_cb, /*Set a callback to get bitmap of a glyp*/ .line_height = 18, /*The real line height where any text fits*/ @@ -685,201 +436,4 @@ lv_font_t neofont15 = { .user_data = 0 /*Optionally some extra user data*/ }; -/* Get info about glyph of `unicode_letter` in `font` font. - * Store the result in `dsc_out`. - * The next letter (`unicode_letter_next`) might be used to calculate the width required by this glyph (kerning) - */ -static bool neofont2_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out, uint32_t unicode_letter, uint32_t unicode_letter_next) -{ - dsc_out->adv_w = 16; /*Horizontal space required by the glyph in [px]*/ - dsc_out->box_h = 20; /*Height of the bitmap in [px]*/ - dsc_out->box_w = 12; /*Width of the bitmap in [px]*/ - dsc_out->ofs_x = 2; /*X offset of the bitmap in [pf]*/ - dsc_out->ofs_y = -2; /*Y offset of the bitmap measured from the as line*/ - dsc_out->bpp = 1; /*Bits per pixel: 1/2/4/8*/ - return true; /*true: glyph found; false: glyph was not found*/ -} - -/* Get the bitmap of `unicode_letter` from `font`. */ -static const uint8_t * neofont2_glyph_bitmap_cb(const lv_font_t * font, uint32_t unicode_letter) -{ - const uint8_t *u = neofont0_glyph_bitmap_cb(font, unicode_letter); - static uint8_t v[30]; - uint8_t u0 = u[0]; - uint8_t u1 = u[1]; - - uint8_t a,b,c, d,e,f, g,h,i, j,k,l, m,n,o; - a = (u0>>7)&1; u0 <<= 1; - b = (u0>>7)&1; u0 <<= 1; - c = (u0>>7)&1; u0 <<= 1; - d = (u0>>7)&1; u0 <<= 1; - e = (u0>>7)&1; u0 <<= 1; - f = (u0>>7)&1; u0 <<= 1; - g = (u0>>7)&1; u0 <<= 1; - h = (u0>>7)&1; - i = (u1>>7)&1; u1 <<= 1; - j = (u1>>7)&1; u1 <<= 1; - k = (u1>>7)&1; u1 <<= 1; - l = (u1>>7)&1; u1 <<= 1; - m = (u1>>7)&1; u1 <<= 1; - n = (u1>>7)&1; u1 <<= 1; - o = (u1>>7)&1; - -#define P(a,b) (a?0xf0:0)|(b?0x0f:0) - - v[0] = P(a,b); - v[1] = P(c, - a); - v[2] = P(b,c); - - v[3] = v[0]; v[4] = v[1]; v[5] = v[2]; - - v[6] = P(d,e); - v[7] = P(f, - d); - v[8] = P(e,f); - - v[9] = v[6]; v[10] = v[7]; v[11] = v[8]; - - v[12] = P(g,h); - v[13] = P(i, - g); - v[14] = P(h,i); - - v[15] = v[12]; v[16] = v[13]; v[17] = v[14]; - - v[18] = P(j,k); - v[19] = P(l, - j); - v[20] = P(k,l); - - v[21] = v[18]; v[22] = v[19]; v[23] = v[20]; - - v[24] = P(m,n); - v[25] = P(o, - m); - v[26] = P(n,o); - - v[27] = v[24]; v[28] = v[25]; v[29] = v[26]; - -#undef P - - return v; /*Or NULL if not found*/ -} - -/*Describe the properties of a font*/ -lv_font_t neofont2 = { - .get_glyph_dsc = neofont2_glyph_dsc_cb, /*Set a callback to get info about gylphs*/ - .get_glyph_bitmap = neofont2_glyph_bitmap_cb, /*Set a callback to get bitmap of a glyp*/ - .line_height = 24, /*The real line height where any text fits*/ - .base_line = 4, /*Base line measured from the top of line_height*/ - .dsc = 0, /*Store any implementation specific data here*/ -#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0) - .subpx = LV_FONT_SUBPX_NONE, -#endif -#if LV_VERSION_CHECK(7, 4, 0) || LVGL_VERSION_MAJOR >= 8 - .underline_position = 0, - .underline_thickness = 0, -#endif - .user_data = 0 /*Optionally some extra user data*/ -}; - -/* Get info about glyph of `unicode_letter` in `font` font. - * Store the result in `dsc_out`. - * The next letter (`unicode_letter_next`) might be used to calculate the width required by this glyph (kerning) - */ -static bool neofont3_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out, uint32_t unicode_letter, uint32_t unicode_letter_next) -{ - dsc_out->adv_w = 32; /*Horizontal space required by the glyph in [px]*/ - dsc_out->box_h = 40; /*Height of the bitmap in [px]*/ - dsc_out->box_w = 24; /*Width of the bitmap in [px]*/ - dsc_out->ofs_x = 4; /*X offset of the bitmap in [pf]*/ - dsc_out->ofs_y = -4; /*Y offset of the bitmap measured from the as line*/ - dsc_out->bpp = 1; /*Bits per pixel: 1/2/4/8*/ - return true; /*true: glyph found; false: glyph was not found*/ -} - -static void mono_bitmap_scale_4( - const uint8_t *u, uint8_t *v, unsigned int w, unsigned int h, - const uint8_t *u0, const uint8_t *u1, - const uint8_t *v0, const uint8_t *v1 -) { - unsigned int y = 0; - uint8_t U; - const uint8_t *V = v; - const uint8_t *v_line_end = &(v[w]); - const uint8_t *v_line_next = &(v[w<<2]); - for (;;) { - U = *u; - if (!(v0 <= v && v < v1)) { - fprintf(stderr, "Overflow 0!\n"); - return; - } - *v = ( ((U&0x80) ? 0xf0 : 0) | ((U&0x40) ? 0x0f : 0) ); - U <<= 2; v++; - if (!(v0 <= v && v < v1)) { return; } - *v = ( ((U&0x80) ? 0xf0 : 0) | ((U&0x40) ? 0x0f : 0) ); - U <<= 2; v++; - if (v >= v_line_end) { - while (v < v_line_next) { - if (!(v0 <= v && v < v1)) { - fprintf(stderr, "Overflow 1!\n"); - return; - } - *v = *V; v++; V++; - } - y++; - if (y >= h) { return; } - V = v; - v_line_end = &(v[w]); - v_line_next = &(v[w<<2]); - } - if (!(v0 <= v && v < v1)) { return; } - *v = ( ((U&0x80) ? 0xf0 : 0) | ((U&0x40) ? 0x0f : 0) ); - U <<= 2; v++; - if (!(v0 <= v && v < v1)) { return; } - *v = ( ((U&0x80) ? 0xf0 : 0) | ((U&0x40) ? 0x0f : 0) ); - u++; v++; - if (v >= v_line_end) { - while (v < v_line_next) { - if (!(v0 <= v && v < v1)) { - fprintf(stderr, "Overflow 2!\n"); - return; - } - *v = *V; v++; V++; - } - y++; - if (y >= h) { return; } - V = v; - v_line_end = &(v[w]); - v_line_next = &(v[w<<2]); - } - } -} - -/* Get the bitmap of `unicode_letter` from `font`. */ -static const uint8_t * neofont3_glyph_bitmap_cb(const lv_font_t * font, uint32_t unicode_letter) -{ - const uint8_t *u = neofont1_glyph_bitmap_cb(font, unicode_letter); - static uint8_t v[120 /* = 40 * 24 / 8 */ ]; - mono_bitmap_scale_4(u,v,6,10,u,u+(60+7)/8,v,v+120); - return v; -} - -/*Describe the properties of a font*/ -const lv_font_t neofont3 = { - .get_glyph_dsc = neofont3_glyph_dsc_cb, /*Set a callback to get info about gylphs*/ - .get_glyph_bitmap = neofont3_glyph_bitmap_cb, /*Set a callback to get bitmap of a glyp*/ - .line_height = 48, /*The real line height where any text fits*/ - .base_line = 8, /*Base line measured from the top of line_height*/ - .dsc = 0, /*Store any implementation specific data here*/ -#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0) - .subpx = LV_FONT_SUBPX_NONE, -#endif -#if LV_VERSION_CHECK(7, 4, 0) || LVGL_VERSION_MAJOR >= 8 - .underline_position = 0, - .underline_thickness = 0, -#endif - .user_data = 0 /*Optionally some extra user data*/ -}; diff --git a/src/displayapp/fonts/neofont.h b/src/displayapp/fonts/neofont.h deleted file mode 100644 index b01a7af..0000000 --- a/src/displayapp/fonts/neofont.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifdef LV_LVGL_H_INCLUDE_SIMPLE -#include "lvgl.h" -#else -#include "lvgl/lvgl.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -// extern const lv_font_t neofont0; -// extern const lv_font_t neofont1; -// extern const lv_font_t neofont2; -extern const lv_font_t neofont3; - -#ifdef __cplusplus -} -#endif - diff --git a/src/displayapp/screens/WatchFaceDigital.cpp b/src/displayapp/screens/WatchFaceDigital.cpp index 8c5b6a8..7c57d15 100644 --- a/src/displayapp/screens/WatchFaceDigital.cpp +++ b/src/displayapp/screens/WatchFaceDigital.cpp @@ -12,7 +12,6 @@ #include "components/ble/NotificationManager.h" #include "components/motion/MotionController.h" #include "components/settings/Settings.h" -#include "displayapp/fonts/neofont.h" using namespace Pinetime::Applications::Screens; WatchFaceDigital::WatchFaceDigital(DisplayApp* app, @@ -33,7 +32,7 @@ WatchFaceDigital::WatchFaceDigital(DisplayApp* app, batteryIcon = lv_label_create(lv_scr_act(), nullptr); lv_label_set_text_fmt(batteryIcon, "B##%%"); - lv_obj_set_style_local_text_font(batteryIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &neofont1); + lv_obj_set_style_local_text_font(batteryIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &neofont15); lv_obj_align(batteryIcon, nullptr, LV_ALIGN_IN_TOP_RIGHT, 0, 0); batteryPlug = lv_label_create(lv_scr_act(), nullptr); @@ -55,10 +54,10 @@ WatchFaceDigital::WatchFaceDigital(DisplayApp* app, lv_obj_align(label_date, nullptr, LV_ALIGN_CENTER, 0, 60); lv_obj_set_auto_realign(label_date, true); lv_obj_set_style_local_text_color(label_date, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x999999)); - lv_obj_set_style_local_text_font(label_date, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &neofont2); + lv_obj_set_style_local_text_font(label_date, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &neofont15); label_time = lv_label_create(lv_scr_act(), nullptr); - lv_obj_set_style_local_text_font(label_time, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &neofont3); + lv_obj_set_style_local_text_font(label_time, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &neofont15); lv_label_set_text_fmt(label_time, hhmm_label_text); lv_obj_align(label_time, nullptr, LV_ALIGN_CENTER, 0, 0); lv_label_set_long_mode(label_time, LV_LABEL_LONG_CROP); @@ -66,7 +65,7 @@ WatchFaceDigital::WatchFaceDigital(DisplayApp* app, label_time_pm = lv_label_create(lv_scr_act(), nullptr); lv_label_set_text_static(label_time_pm, "P"); - lv_obj_set_style_local_text_font(label_time_pm, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &neofont1); + lv_obj_set_style_local_text_font(label_time_pm, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &neofont15); lv_obj_align(label_time_pm, label_time, LV_ALIGN_OUT_LEFT_TOP, 0, 0); lv_obj_set_hidden(label_time_pm, 1); diff --git a/src/libs/lv_conf.h b/src/libs/lv_conf.h index dfec64a..32b4f4d 100644 --- a/src/libs/lv_conf.h +++ b/src/libs/lv_conf.h @@ -413,10 +413,7 @@ typedef void* lv_indev_drv_user_data_t; /*Type of user data in the in * LV_FONT_DECLARE(my_font_2) */ -#define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(neofont0) \ - LV_FONT_DECLARE(neofont1) \ - LV_FONT_DECLARE(neofont15) \ - LV_FONT_DECLARE(neofont2) \ +#define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(neofont15) \ LV_FONT_DECLARE(lv_font_sys_48) /* Enable it if you have fonts with a lot of characters. @@ -477,10 +474,10 @@ typedef void* lv_font_user_data_t; #define LV_THEME_DEFAULT_COLOR_PRIMARY lv_color_hex(0xffffff) #define LV_THEME_DEFAULT_COLOR_SECONDARY lv_color_hex(0xaaaaaa) #define LV_THEME_DEFAULT_FLAG 0//LV_THEME_MATERIAL_FLAG_DARK -#define LV_THEME_DEFAULT_FONT_SMALL &neofont1 -#define LV_THEME_DEFAULT_FONT_NORMAL &neofont1 -#define LV_THEME_DEFAULT_FONT_SUBTITLE &neofont1 -#define LV_THEME_DEFAULT_FONT_TITLE &neofont1 +#define LV_THEME_DEFAULT_FONT_SMALL &neofont15 +#define LV_THEME_DEFAULT_FONT_NORMAL &neofont15 +#define LV_THEME_DEFAULT_FONT_SUBTITLE &neofont15 +#define LV_THEME_DEFAULT_FONT_TITLE &neofont15 /*================= * Text settings diff --git a/src/libs/lvgl b/src/libs/lvgl index 23430cf..d2ea09a 160000 --- a/src/libs/lvgl +++ b/src/libs/lvgl @@ -1 +1 @@ -Subproject commit 23430cf20e32294549fff9b2879a9466dacc19bb +Subproject commit d2ea09a907e87c191dd050523a262c4ec1a863a3 -- cgit v0.10.2