From 8166dd9fc6c16b10bfc0fc86d1f28fdf763cf784 Mon Sep 17 00:00:00 2001 From: Michele Bini Date: Wed, 30 Mar 2022 22:16:02 +0200 Subject: font adjustments diff --git a/src/displayapp/fonts/lv_font_sys_48.c b/src/displayapp/fonts/lv_font_sys_48.c index ca007e3..dfde9ab 100644 --- a/src/displayapp/fonts/lv_font_sys_48.c +++ b/src/displayapp/fonts/lv_font_sys_48.c @@ -299,11 +299,7 @@ static lv_font_fmt_txt_dsc_t font_dsc = { *----------------*/ /*Initialize a public general font descriptor*/ -#if LV_VERSION_CHECK(8, 0, 0) const lv_font_t lv_font_sys_48 = { -#else -lv_font_t lv_font_sys_48 = { -#endif .get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/ .get_glyph_bitmap = lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/ .line_height = 46, /*The maximum line height required by the font*/ diff --git a/src/displayapp/fonts/neofont.c b/src/displayapp/fonts/neofont.c index 12a467a..c868c99 100644 --- a/src/displayapp/fonts/neofont.c +++ b/src/displayapp/fonts/neofont.c @@ -25,7 +25,7 @@ #define X 1 #define _ 0 -static uint8_t glyphs[][2] = { +static const uint8_t glyphs[][2] = { G( _, X, _, X, _, X, X, _, X, @@ -38,8 +38,8 @@ static uint8_t glyphs[][2] = { _, X, _, X, X, X ), - G( _, X, _, - X, _, X, + G( X, X, _, + _, _, X, _, _, X, _, X, _, X, X, X ), @@ -404,8 +404,8 @@ static bool neofont1_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_t * 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 = 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->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*/ @@ -563,8 +563,8 @@ static bool neofont2_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_t * 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 = 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->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*/ } @@ -662,16 +662,16 @@ static bool neofont3_glyph_dsc_cb(const lv_font_t * font, lv_font_glyph_dsc_t * 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 = 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->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, - uint8_t *u0, uint8_t *u1, - uint8_t *v0, uint8_t *v1 + const uint8_t *u0, const uint8_t *u1, + const uint8_t *v0, const uint8_t *v1 ) { unsigned int y = 0; uint8_t U; -- cgit v0.10.2