A36模拟器工程
This commit is contained in:
@ -0,0 +1,489 @@
|
||||
/*******************************************************************************
|
||||
* Size: 16 px
|
||||
* Bpp: 4
|
||||
* Opts:
|
||||
******************************************************************************/
|
||||
|
||||
#ifdef LV_LVGL_H_INCLUDE_SIMPLE
|
||||
#include "lvgl.h"
|
||||
#else
|
||||
#include "lvgl/lvgl.h"
|
||||
#endif
|
||||
|
||||
#ifndef MXC_WRYH_BPP4_16PX
|
||||
#define MXC_WRYH_BPP4_16PX 1
|
||||
#endif
|
||||
|
||||
#if MXC_WRYH_BPP4_16PX
|
||||
|
||||
/*-----------------
|
||||
* BITMAPS
|
||||
*----------------*/
|
||||
|
||||
/*Store the image of the glyphs*/
|
||||
#include "bin_font.h"
|
||||
|
||||
/*---------------------
|
||||
* GLYPH DESCRIPTION
|
||||
*--------------------*/
|
||||
|
||||
|
||||
/*---------------------
|
||||
* CHARACTER MAPPING
|
||||
*--------------------*/
|
||||
|
||||
static const uint16_t unicode_list_3[] = {
|
||||
0x0, 0x5690, 0x5b58, 0x5dbc, 0x5f84, 0x653f, 0x6649, 0x7954,
|
||||
0x8aea, 0x8f68, 0x9115, 0x9a21
|
||||
};
|
||||
|
||||
/*Collect the unicode lists and glyph_id offsets*/
|
||||
static const lv_font_fmt_txt_cmap_t cmaps[] =
|
||||
{
|
||||
{
|
||||
.range_start = 46, .range_length = 13, .glyph_id_start = 1,
|
||||
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
|
||||
},
|
||||
{
|
||||
.range_start = 65, .range_length = 26, .glyph_id_start = 14,
|
||||
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
|
||||
},
|
||||
{
|
||||
.range_start = 97, .range_length = 26, .glyph_id_start = 40,
|
||||
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
|
||||
},
|
||||
{
|
||||
.range_start = 183, .range_length = 39458, .glyph_id_start = 66,
|
||||
.unicode_list = unicode_list_3, .glyph_id_ofs_list = NULL, .list_length = 12, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY
|
||||
}
|
||||
};
|
||||
|
||||
/*-----------------
|
||||
* KERNING
|
||||
*----------------*/
|
||||
|
||||
|
||||
/*Pair left and right glyphs for kerning*/
|
||||
static const uint8_t kern_pair_glyph_ids[] =
|
||||
{
|
||||
14, 16,
|
||||
14, 20,
|
||||
14, 23,
|
||||
14, 28,
|
||||
14, 33,
|
||||
14, 34,
|
||||
14, 35,
|
||||
14, 36,
|
||||
14, 38,
|
||||
14, 39,
|
||||
14, 59,
|
||||
14, 61,
|
||||
14, 62,
|
||||
14, 64,
|
||||
15, 33,
|
||||
15, 38,
|
||||
16, 16,
|
||||
16, 20,
|
||||
16, 28,
|
||||
16, 30,
|
||||
17, 1,
|
||||
17, 14,
|
||||
17, 33,
|
||||
17, 37,
|
||||
17, 39,
|
||||
18, 14,
|
||||
18, 23,
|
||||
18, 33,
|
||||
18, 36,
|
||||
18, 37,
|
||||
19, 1,
|
||||
19, 14,
|
||||
19, 23,
|
||||
19, 32,
|
||||
19, 33,
|
||||
19, 40,
|
||||
19, 45,
|
||||
20, 33,
|
||||
20, 35,
|
||||
20, 64,
|
||||
23, 1,
|
||||
23, 14,
|
||||
23, 23,
|
||||
23, 40,
|
||||
24, 16,
|
||||
24, 20,
|
||||
24, 23,
|
||||
24, 28,
|
||||
24, 30,
|
||||
24, 37,
|
||||
24, 39,
|
||||
24, 42,
|
||||
24, 43,
|
||||
24, 44,
|
||||
24, 46,
|
||||
24, 54,
|
||||
24, 56,
|
||||
24, 59,
|
||||
24, 61,
|
||||
24, 62,
|
||||
24, 64,
|
||||
25, 14,
|
||||
25, 16,
|
||||
25, 20,
|
||||
25, 23,
|
||||
25, 28,
|
||||
25, 30,
|
||||
25, 33,
|
||||
25, 34,
|
||||
25, 35,
|
||||
25, 36,
|
||||
25, 38,
|
||||
25, 39,
|
||||
25, 59,
|
||||
25, 61,
|
||||
25, 62,
|
||||
25, 64,
|
||||
28, 1,
|
||||
28, 14,
|
||||
28, 23,
|
||||
28, 33,
|
||||
28, 37,
|
||||
28, 38,
|
||||
28, 39,
|
||||
29, 1,
|
||||
29, 14,
|
||||
29, 20,
|
||||
29, 23,
|
||||
29, 36,
|
||||
29, 37,
|
||||
29, 40,
|
||||
29, 42,
|
||||
29, 43,
|
||||
29, 44,
|
||||
29, 46,
|
||||
29, 54,
|
||||
29, 56,
|
||||
30, 1,
|
||||
30, 14,
|
||||
30, 33,
|
||||
30, 37,
|
||||
30, 38,
|
||||
30, 39,
|
||||
31, 16,
|
||||
31, 20,
|
||||
31, 23,
|
||||
31, 28,
|
||||
31, 30,
|
||||
31, 33,
|
||||
31, 38,
|
||||
31, 42,
|
||||
31, 43,
|
||||
31, 44,
|
||||
31, 46,
|
||||
31, 54,
|
||||
31, 56,
|
||||
32, 59,
|
||||
32, 61,
|
||||
32, 62,
|
||||
32, 64,
|
||||
33, 1,
|
||||
33, 13,
|
||||
33, 14,
|
||||
33, 16,
|
||||
33, 20,
|
||||
33, 23,
|
||||
33, 28,
|
||||
33, 30,
|
||||
33, 33,
|
||||
33, 35,
|
||||
33, 36,
|
||||
33, 37,
|
||||
33, 38,
|
||||
33, 40,
|
||||
33, 42,
|
||||
33, 43,
|
||||
33, 44,
|
||||
33, 45,
|
||||
33, 46,
|
||||
33, 52,
|
||||
33, 53,
|
||||
33, 54,
|
||||
33, 55,
|
||||
33, 56,
|
||||
33, 57,
|
||||
33, 58,
|
||||
33, 60,
|
||||
33, 61,
|
||||
33, 62,
|
||||
33, 63,
|
||||
33, 64,
|
||||
33, 65,
|
||||
34, 14,
|
||||
35, 1,
|
||||
35, 14,
|
||||
35, 16,
|
||||
35, 20,
|
||||
35, 23,
|
||||
35, 28,
|
||||
35, 30,
|
||||
35, 32,
|
||||
35, 33,
|
||||
35, 40,
|
||||
35, 42,
|
||||
35, 43,
|
||||
35, 44,
|
||||
35, 46,
|
||||
35, 52,
|
||||
35, 53,
|
||||
35, 54,
|
||||
35, 55,
|
||||
35, 56,
|
||||
35, 57,
|
||||
35, 58,
|
||||
35, 60,
|
||||
36, 1,
|
||||
36, 14,
|
||||
36, 33,
|
||||
36, 40,
|
||||
36, 42,
|
||||
36, 43,
|
||||
36, 44,
|
||||
36, 46,
|
||||
36, 54,
|
||||
36, 56,
|
||||
37, 1,
|
||||
37, 16,
|
||||
37, 20,
|
||||
37, 23,
|
||||
37, 28,
|
||||
37, 30,
|
||||
37, 33,
|
||||
38, 1,
|
||||
38, 14,
|
||||
38, 16,
|
||||
38, 20,
|
||||
38, 23,
|
||||
38, 28,
|
||||
38, 30,
|
||||
38, 32,
|
||||
38, 33,
|
||||
38, 40,
|
||||
38, 42,
|
||||
38, 43,
|
||||
38, 44,
|
||||
38, 45,
|
||||
38, 46,
|
||||
38, 52,
|
||||
38, 53,
|
||||
38, 54,
|
||||
38, 55,
|
||||
38, 56,
|
||||
38, 57,
|
||||
38, 58,
|
||||
38, 60,
|
||||
39, 23,
|
||||
39, 33,
|
||||
39, 64,
|
||||
41, 40,
|
||||
41, 45,
|
||||
41, 63,
|
||||
42, 23,
|
||||
42, 33,
|
||||
42, 38,
|
||||
45, 1,
|
||||
45, 13,
|
||||
45, 41,
|
||||
45, 47,
|
||||
45, 59,
|
||||
45, 61,
|
||||
45, 62,
|
||||
45, 63,
|
||||
45, 64,
|
||||
46, 49,
|
||||
49, 49,
|
||||
50, 1,
|
||||
50, 13,
|
||||
50, 42,
|
||||
50, 43,
|
||||
50, 44,
|
||||
50, 46,
|
||||
50, 54,
|
||||
50, 56,
|
||||
50, 59,
|
||||
54, 40,
|
||||
54, 45,
|
||||
54, 63,
|
||||
55, 40,
|
||||
55, 45,
|
||||
55, 63,
|
||||
56, 49,
|
||||
57, 1,
|
||||
57, 13,
|
||||
57, 42,
|
||||
57, 43,
|
||||
57, 44,
|
||||
57, 45,
|
||||
57, 46,
|
||||
57, 52,
|
||||
57, 53,
|
||||
57, 54,
|
||||
57, 56,
|
||||
57, 58,
|
||||
57, 59,
|
||||
57, 61,
|
||||
57, 62,
|
||||
57, 63,
|
||||
57, 64,
|
||||
57, 65,
|
||||
59, 42,
|
||||
59, 43,
|
||||
59, 44,
|
||||
59, 46,
|
||||
59, 54,
|
||||
59, 56,
|
||||
59, 63,
|
||||
61, 1,
|
||||
61, 40,
|
||||
61, 42,
|
||||
61, 43,
|
||||
61, 44,
|
||||
61, 46,
|
||||
61, 54,
|
||||
61, 56,
|
||||
62, 1,
|
||||
62, 42,
|
||||
62, 43,
|
||||
62, 44,
|
||||
62, 46,
|
||||
62, 54,
|
||||
62, 56,
|
||||
63, 42,
|
||||
63, 43,
|
||||
63, 44,
|
||||
63, 46,
|
||||
63, 54,
|
||||
63, 56,
|
||||
64, 1,
|
||||
64, 42,
|
||||
64, 43,
|
||||
64, 44,
|
||||
64, 45,
|
||||
64, 46,
|
||||
64, 54,
|
||||
64, 56,
|
||||
64, 59
|
||||
};
|
||||
|
||||
/* Kerning between the respective left and right glyphs
|
||||
* 4.4 format which needs to scaled with `kern_scale`*/
|
||||
static const int8_t kern_pair_values[] =
|
||||
{
|
||||
-4, -4, 13, -4, -20, -4, -16, -10,
|
||||
-21, 8, -4, -6, -4, -5, -12, -9,
|
||||
-7, -7, -4, -7, -17, -4, -12, -7,
|
||||
-7, 1, 9, 1, 4, 1, -21, -18,
|
||||
-9, -4, 2, -10, 1, -7, -4, -4,
|
||||
-14, -5, -9, -4, -12, -12, 12, -12,
|
||||
-12, 5, 5, -4, -4, -4, -4, -4,
|
||||
-4, -6, -10, -7, -12, 8, -9, -9,
|
||||
14, -9, -9, -15, -4, -16, -7, -17,
|
||||
8, -4, -14, -9, -10, -12, -4, -1,
|
||||
-12, -5, -3, -7, -44, -21, -1, -17,
|
||||
5, -8, -9, -10, -10, -10, -10, -10,
|
||||
-10, -17, -4, -12, -5, -1, -7, -4,
|
||||
-4, 8, -3, -3, -7, -5, -7, -7,
|
||||
-8, -8, -8, -7, -9, -7, -4, -6,
|
||||
-24, -3, -21, -12, -12, -15, -12, -12,
|
||||
5, 6, 5, -1, 4, -29, -28, -28,
|
||||
-28, -13, -28, -24, -24, -28, -24, -28,
|
||||
-24, -21, -24, -14, -15, -24, -15, -17,
|
||||
-5, -31, -16, -6, -6, -9, -2, -6,
|
||||
-4, 5, -20, -17, -17, -17, -17, -10,
|
||||
-10, -17, -10, -17, -10, -9, -10, -17,
|
||||
-10, 5, -10, -7, -7, -7, -7, -7,
|
||||
-7, 8, -3, -3, 13, -3, -3, 5,
|
||||
-26, -21, -6, -6, -9, -6, -6, -4,
|
||||
5, -27, -24, -24, -24, -4, -24, -19,
|
||||
-19, -24, -19, -24, -19, -18, -19, 11,
|
||||
5, -7, -4, -1, -3, 10, -14, -10,
|
||||
-17, 11, 2, 2, 5, 5, 5, 2,
|
||||
5, 6, 5, 11, 11, -5, -4, -5,
|
||||
-5, -5, -4, -2, -4, -5, -3, -4,
|
||||
-5, -3, 14, -23, 11, -4, -4, -4,
|
||||
5, -4, 0, 0, -4, -4, 2, 8,
|
||||
11, 11, 8, 11, 5, -4, -4, -2,
|
||||
-2, -2, -2, 4, -17, -5, -2, -2,
|
||||
-2, -2, -2, -2, -14, -1, -1, -1,
|
||||
-1, -1, -1, -2, -2, -2, -2, -2,
|
||||
-2, -17, -1, -1, -1, 1, -1, -1,
|
||||
-1, 1
|
||||
};
|
||||
|
||||
/*Collect the kern pair's data in one place*/
|
||||
static const lv_font_fmt_txt_kern_pair_t kern_pairs =
|
||||
{
|
||||
.glyph_ids = kern_pair_glyph_ids,
|
||||
.values = kern_pair_values,
|
||||
.pair_cnt = 306,
|
||||
.glyph_ids_size = 0
|
||||
};
|
||||
|
||||
/*--------------------
|
||||
* ALL CUSTOM DATA
|
||||
*--------------------*/
|
||||
|
||||
#if LVGL_VERSION_MAJOR == 8
|
||||
/*Store all the custom data of the font*/
|
||||
static lv_font_fmt_txt_glyph_cache_t cache;
|
||||
#endif
|
||||
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
static const lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
#else
|
||||
static lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
#endif
|
||||
.glyph_bitmap = MXC_WRYH_bpp4_16px_glyph_bitmap,
|
||||
.glyph_dsc = MXC_WRYH_bpp4_16px_glyph_dsc,
|
||||
.cmaps = cmaps,
|
||||
.kern_dsc = &kern_pairs,
|
||||
.kern_scale = 16,
|
||||
.cmap_num = 4,
|
||||
.bpp = 4,
|
||||
.kern_classes = 0,
|
||||
.bitmap_format = 0,
|
||||
#if LVGL_VERSION_MAJOR == 8
|
||||
.cache = &cache
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
/*-----------------
|
||||
* PUBLIC FONT
|
||||
*----------------*/
|
||||
|
||||
/*Initialize a public general font descriptor*/
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
const lv_font_t MXC_WRYH_bpp4_16px = {
|
||||
#else
|
||||
lv_font_t MXC_WRYH_bpp4_16px = {
|
||||
#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 = 18, /*The maximum line height required by the font*/
|
||||
.base_line = 4, /*Baseline measured from the bottom of the line*/
|
||||
#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 = -1,
|
||||
.underline_thickness = 1,
|
||||
#endif
|
||||
.dsc = &font_dsc, /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
|
||||
.fallback = NULL,
|
||||
.user_data = NULL
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif /*#if MXC_WRYH_BPP4_16PX*/
|
||||
|
@ -0,0 +1,489 @@
|
||||
/*******************************************************************************
|
||||
* Size: 18 px
|
||||
* Bpp: 4
|
||||
* Opts:
|
||||
******************************************************************************/
|
||||
|
||||
#ifdef LV_LVGL_H_INCLUDE_SIMPLE
|
||||
#include "lvgl.h"
|
||||
#else
|
||||
#include "lvgl/lvgl.h"
|
||||
#endif
|
||||
|
||||
#ifndef MXC_WRYH_BPP4_18PX
|
||||
#define MXC_WRYH_BPP4_18PX 1
|
||||
#endif
|
||||
|
||||
#if MXC_WRYH_BPP4_18PX
|
||||
|
||||
/*-----------------
|
||||
* BITMAPS
|
||||
*----------------*/
|
||||
|
||||
/*Store the image of the glyphs*/
|
||||
#include "bin_font.h"
|
||||
|
||||
/*---------------------
|
||||
* GLYPH DESCRIPTION
|
||||
*--------------------*/
|
||||
|
||||
|
||||
/*---------------------
|
||||
* CHARACTER MAPPING
|
||||
*--------------------*/
|
||||
|
||||
static const uint16_t unicode_list_3[] = {
|
||||
0x0, 0x5690, 0x5b58, 0x5dbc, 0x5f84, 0x653f, 0x6649, 0x7954,
|
||||
0x8aea, 0x8f68, 0x9115, 0x9a21
|
||||
};
|
||||
|
||||
/*Collect the unicode lists and glyph_id offsets*/
|
||||
static const lv_font_fmt_txt_cmap_t cmaps[] =
|
||||
{
|
||||
{
|
||||
.range_start = 46, .range_length = 13, .glyph_id_start = 1,
|
||||
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
|
||||
},
|
||||
{
|
||||
.range_start = 65, .range_length = 26, .glyph_id_start = 14,
|
||||
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
|
||||
},
|
||||
{
|
||||
.range_start = 97, .range_length = 26, .glyph_id_start = 40,
|
||||
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
|
||||
},
|
||||
{
|
||||
.range_start = 183, .range_length = 39458, .glyph_id_start = 66,
|
||||
.unicode_list = unicode_list_3, .glyph_id_ofs_list = NULL, .list_length = 12, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY
|
||||
}
|
||||
};
|
||||
|
||||
/*-----------------
|
||||
* KERNING
|
||||
*----------------*/
|
||||
|
||||
|
||||
/*Pair left and right glyphs for kerning*/
|
||||
static const uint8_t kern_pair_glyph_ids[] =
|
||||
{
|
||||
14, 16,
|
||||
14, 20,
|
||||
14, 23,
|
||||
14, 28,
|
||||
14, 33,
|
||||
14, 34,
|
||||
14, 35,
|
||||
14, 36,
|
||||
14, 38,
|
||||
14, 39,
|
||||
14, 59,
|
||||
14, 61,
|
||||
14, 62,
|
||||
14, 64,
|
||||
15, 33,
|
||||
15, 38,
|
||||
16, 16,
|
||||
16, 20,
|
||||
16, 28,
|
||||
16, 30,
|
||||
17, 1,
|
||||
17, 14,
|
||||
17, 33,
|
||||
17, 37,
|
||||
17, 39,
|
||||
18, 14,
|
||||
18, 23,
|
||||
18, 33,
|
||||
18, 36,
|
||||
18, 37,
|
||||
19, 1,
|
||||
19, 14,
|
||||
19, 23,
|
||||
19, 32,
|
||||
19, 33,
|
||||
19, 40,
|
||||
19, 45,
|
||||
20, 33,
|
||||
20, 35,
|
||||
20, 64,
|
||||
23, 1,
|
||||
23, 14,
|
||||
23, 23,
|
||||
23, 40,
|
||||
24, 16,
|
||||
24, 20,
|
||||
24, 23,
|
||||
24, 28,
|
||||
24, 30,
|
||||
24, 37,
|
||||
24, 39,
|
||||
24, 42,
|
||||
24, 43,
|
||||
24, 44,
|
||||
24, 46,
|
||||
24, 54,
|
||||
24, 56,
|
||||
24, 59,
|
||||
24, 61,
|
||||
24, 62,
|
||||
24, 64,
|
||||
25, 14,
|
||||
25, 16,
|
||||
25, 20,
|
||||
25, 23,
|
||||
25, 28,
|
||||
25, 30,
|
||||
25, 33,
|
||||
25, 34,
|
||||
25, 35,
|
||||
25, 36,
|
||||
25, 38,
|
||||
25, 39,
|
||||
25, 59,
|
||||
25, 61,
|
||||
25, 62,
|
||||
25, 64,
|
||||
28, 1,
|
||||
28, 14,
|
||||
28, 23,
|
||||
28, 33,
|
||||
28, 37,
|
||||
28, 38,
|
||||
28, 39,
|
||||
29, 1,
|
||||
29, 14,
|
||||
29, 20,
|
||||
29, 23,
|
||||
29, 36,
|
||||
29, 37,
|
||||
29, 40,
|
||||
29, 42,
|
||||
29, 43,
|
||||
29, 44,
|
||||
29, 46,
|
||||
29, 54,
|
||||
29, 56,
|
||||
30, 1,
|
||||
30, 14,
|
||||
30, 33,
|
||||
30, 37,
|
||||
30, 38,
|
||||
30, 39,
|
||||
31, 16,
|
||||
31, 20,
|
||||
31, 23,
|
||||
31, 28,
|
||||
31, 30,
|
||||
31, 33,
|
||||
31, 38,
|
||||
31, 42,
|
||||
31, 43,
|
||||
31, 44,
|
||||
31, 46,
|
||||
31, 54,
|
||||
31, 56,
|
||||
32, 59,
|
||||
32, 61,
|
||||
32, 62,
|
||||
32, 64,
|
||||
33, 1,
|
||||
33, 13,
|
||||
33, 14,
|
||||
33, 16,
|
||||
33, 20,
|
||||
33, 23,
|
||||
33, 28,
|
||||
33, 30,
|
||||
33, 33,
|
||||
33, 35,
|
||||
33, 36,
|
||||
33, 37,
|
||||
33, 38,
|
||||
33, 40,
|
||||
33, 42,
|
||||
33, 43,
|
||||
33, 44,
|
||||
33, 45,
|
||||
33, 46,
|
||||
33, 52,
|
||||
33, 53,
|
||||
33, 54,
|
||||
33, 55,
|
||||
33, 56,
|
||||
33, 57,
|
||||
33, 58,
|
||||
33, 60,
|
||||
33, 61,
|
||||
33, 62,
|
||||
33, 63,
|
||||
33, 64,
|
||||
33, 65,
|
||||
34, 14,
|
||||
35, 1,
|
||||
35, 14,
|
||||
35, 16,
|
||||
35, 20,
|
||||
35, 23,
|
||||
35, 28,
|
||||
35, 30,
|
||||
35, 32,
|
||||
35, 33,
|
||||
35, 40,
|
||||
35, 42,
|
||||
35, 43,
|
||||
35, 44,
|
||||
35, 46,
|
||||
35, 52,
|
||||
35, 53,
|
||||
35, 54,
|
||||
35, 55,
|
||||
35, 56,
|
||||
35, 57,
|
||||
35, 58,
|
||||
35, 60,
|
||||
36, 1,
|
||||
36, 14,
|
||||
36, 33,
|
||||
36, 40,
|
||||
36, 42,
|
||||
36, 43,
|
||||
36, 44,
|
||||
36, 46,
|
||||
36, 54,
|
||||
36, 56,
|
||||
37, 1,
|
||||
37, 16,
|
||||
37, 20,
|
||||
37, 23,
|
||||
37, 28,
|
||||
37, 30,
|
||||
37, 33,
|
||||
38, 1,
|
||||
38, 14,
|
||||
38, 16,
|
||||
38, 20,
|
||||
38, 23,
|
||||
38, 28,
|
||||
38, 30,
|
||||
38, 32,
|
||||
38, 33,
|
||||
38, 40,
|
||||
38, 42,
|
||||
38, 43,
|
||||
38, 44,
|
||||
38, 45,
|
||||
38, 46,
|
||||
38, 52,
|
||||
38, 53,
|
||||
38, 54,
|
||||
38, 55,
|
||||
38, 56,
|
||||
38, 57,
|
||||
38, 58,
|
||||
38, 60,
|
||||
39, 23,
|
||||
39, 33,
|
||||
39, 64,
|
||||
41, 40,
|
||||
41, 45,
|
||||
41, 63,
|
||||
42, 23,
|
||||
42, 33,
|
||||
42, 38,
|
||||
45, 1,
|
||||
45, 13,
|
||||
45, 41,
|
||||
45, 47,
|
||||
45, 59,
|
||||
45, 61,
|
||||
45, 62,
|
||||
45, 63,
|
||||
45, 64,
|
||||
46, 49,
|
||||
49, 49,
|
||||
50, 1,
|
||||
50, 13,
|
||||
50, 42,
|
||||
50, 43,
|
||||
50, 44,
|
||||
50, 46,
|
||||
50, 54,
|
||||
50, 56,
|
||||
50, 59,
|
||||
54, 40,
|
||||
54, 45,
|
||||
54, 63,
|
||||
55, 40,
|
||||
55, 45,
|
||||
55, 63,
|
||||
56, 49,
|
||||
57, 1,
|
||||
57, 13,
|
||||
57, 42,
|
||||
57, 43,
|
||||
57, 44,
|
||||
57, 45,
|
||||
57, 46,
|
||||
57, 52,
|
||||
57, 53,
|
||||
57, 54,
|
||||
57, 56,
|
||||
57, 58,
|
||||
57, 59,
|
||||
57, 61,
|
||||
57, 62,
|
||||
57, 63,
|
||||
57, 64,
|
||||
57, 65,
|
||||
59, 42,
|
||||
59, 43,
|
||||
59, 44,
|
||||
59, 46,
|
||||
59, 54,
|
||||
59, 56,
|
||||
59, 63,
|
||||
61, 1,
|
||||
61, 40,
|
||||
61, 42,
|
||||
61, 43,
|
||||
61, 44,
|
||||
61, 46,
|
||||
61, 54,
|
||||
61, 56,
|
||||
62, 1,
|
||||
62, 42,
|
||||
62, 43,
|
||||
62, 44,
|
||||
62, 46,
|
||||
62, 54,
|
||||
62, 56,
|
||||
63, 42,
|
||||
63, 43,
|
||||
63, 44,
|
||||
63, 46,
|
||||
63, 54,
|
||||
63, 56,
|
||||
64, 1,
|
||||
64, 42,
|
||||
64, 43,
|
||||
64, 44,
|
||||
64, 45,
|
||||
64, 46,
|
||||
64, 54,
|
||||
64, 56,
|
||||
64, 59
|
||||
};
|
||||
|
||||
/* Kerning between the respective left and right glyphs
|
||||
* 4.4 format which needs to scaled with `kern_scale`*/
|
||||
static const int8_t kern_pair_values[] =
|
||||
{
|
||||
-4, -4, 14, -4, -22, -4, -18, -11,
|
||||
-24, 9, -4, -6, -4, -6, -14, -10,
|
||||
-8, -8, -4, -8, -20, -5, -14, -8,
|
||||
-7, 2, 10, 1, 4, 1, -23, -20,
|
||||
-10, -4, 2, -12, 2, -7, -4, -4,
|
||||
-15, -6, -10, -4, -14, -14, 14, -14,
|
||||
-14, 6, 6, -4, -4, -4, -4, -4,
|
||||
-4, -7, -11, -8, -14, 9, -10, -10,
|
||||
15, -11, -11, -17, -4, -18, -7, -20,
|
||||
9, -4, -15, -10, -12, -14, -4, -2,
|
||||
-14, -6, -4, -7, -49, -24, -2, -20,
|
||||
6, -9, -10, -12, -12, -12, -12, -12,
|
||||
-11, -20, -4, -14, -6, -2, -7, -4,
|
||||
-4, 9, -3, -3, -8, -6, -8, -8,
|
||||
-9, -9, -9, -8, -10, -7, -4, -7,
|
||||
-27, -4, -23, -14, -14, -17, -14, -14,
|
||||
6, 6, 6, -1, 4, -33, -32, -32,
|
||||
-32, -15, -32, -27, -27, -32, -27, -32,
|
||||
-27, -23, -27, -15, -17, -27, -17, -20,
|
||||
-6, -35, -18, -6, -6, -11, -2, -6,
|
||||
-4, 6, -22, -20, -20, -20, -20, -12,
|
||||
-12, -20, -12, -20, -12, -10, -12, -20,
|
||||
-11, 6, -12, -7, -7, -7, -7, -7,
|
||||
-7, 9, -4, -4, 15, -4, -4, 5,
|
||||
-30, -24, -7, -7, -10, -7, -7, -4,
|
||||
6, -30, -27, -27, -27, -4, -27, -21,
|
||||
-21, -27, -21, -27, -21, -20, -21, 13,
|
||||
6, -8, -4, -2, -4, 11, -15, -12,
|
||||
-20, 13, 3, 3, 6, 6, 6, 3,
|
||||
5, 7, 5, 13, 13, -6, -4, -6,
|
||||
-6, -6, -4, -2, -4, -6, -4, -4,
|
||||
-6, -4, 15, -26, 13, -4, -4, -4,
|
||||
6, -4, -1, -1, -4, -4, 2, 9,
|
||||
13, 13, 9, 13, 6, -4, -4, -2,
|
||||
-2, -2, -2, 4, -20, -6, -2, -2,
|
||||
-2, -2, -2, -2, -15, -1, -2, -2,
|
||||
-1, -1, -2, -2, -2, -2, -2, -2,
|
||||
-2, -19, -2, -2, -2, 1, -2, -2,
|
||||
-2, 1
|
||||
};
|
||||
|
||||
/*Collect the kern pair's data in one place*/
|
||||
static const lv_font_fmt_txt_kern_pair_t kern_pairs =
|
||||
{
|
||||
.glyph_ids = kern_pair_glyph_ids,
|
||||
.values = kern_pair_values,
|
||||
.pair_cnt = 306,
|
||||
.glyph_ids_size = 0
|
||||
};
|
||||
|
||||
/*--------------------
|
||||
* ALL CUSTOM DATA
|
||||
*--------------------*/
|
||||
|
||||
#if LVGL_VERSION_MAJOR == 8
|
||||
/*Store all the custom data of the font*/
|
||||
static lv_font_fmt_txt_glyph_cache_t cache;
|
||||
#endif
|
||||
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
static const lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
#else
|
||||
static lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
#endif
|
||||
.glyph_bitmap = MXC_WRYH_bpp4_18px_glyph_bitmap,
|
||||
.glyph_dsc = MXC_WRYH_bpp4_18px_glyph_dsc,
|
||||
.cmaps = cmaps,
|
||||
.kern_dsc = &kern_pairs,
|
||||
.kern_scale = 16,
|
||||
.cmap_num = 4,
|
||||
.bpp = 4,
|
||||
.kern_classes = 0,
|
||||
.bitmap_format = 0,
|
||||
#if LVGL_VERSION_MAJOR == 8
|
||||
.cache = &cache
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
/*-----------------
|
||||
* PUBLIC FONT
|
||||
*----------------*/
|
||||
|
||||
/*Initialize a public general font descriptor*/
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
const lv_font_t MXC_WRYH_bpp4_18px = {
|
||||
#else
|
||||
lv_font_t MXC_WRYH_bpp4_18px = {
|
||||
#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 = 20, /*The maximum line height required by the font*/
|
||||
.base_line = 4, /*Baseline measured from the bottom of the line*/
|
||||
#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 = -2,
|
||||
.underline_thickness = 1,
|
||||
#endif
|
||||
.dsc = &font_dsc, /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
|
||||
.fallback = NULL,
|
||||
.user_data = NULL
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif /*#if MXC_WRYH_BPP4_18PX*/
|
||||
|
@ -0,0 +1,489 @@
|
||||
/*******************************************************************************
|
||||
* Size: 20 px
|
||||
* Bpp: 4
|
||||
* Opts:
|
||||
******************************************************************************/
|
||||
|
||||
#ifdef LV_LVGL_H_INCLUDE_SIMPLE
|
||||
#include "lvgl.h"
|
||||
#else
|
||||
#include "lvgl/lvgl.h"
|
||||
#endif
|
||||
|
||||
#ifndef MXC_WRYH_BPP4_20PX
|
||||
#define MXC_WRYH_BPP4_20PX 1
|
||||
#endif
|
||||
|
||||
#if MXC_WRYH_BPP4_20PX
|
||||
|
||||
/*-----------------
|
||||
* BITMAPS
|
||||
*----------------*/
|
||||
|
||||
/*Store the image of the glyphs*/
|
||||
#include "bin_font.h"
|
||||
|
||||
/*---------------------
|
||||
* GLYPH DESCRIPTION
|
||||
*--------------------*/
|
||||
|
||||
|
||||
/*---------------------
|
||||
* CHARACTER MAPPING
|
||||
*--------------------*/
|
||||
|
||||
static const uint16_t unicode_list_3[] = {
|
||||
0x0, 0x5690, 0x5b58, 0x5dbc, 0x5f84, 0x653f, 0x6649, 0x7954,
|
||||
0x8aea, 0x8f68, 0x9115, 0x9a21
|
||||
};
|
||||
|
||||
/*Collect the unicode lists and glyph_id offsets*/
|
||||
static const lv_font_fmt_txt_cmap_t cmaps[] =
|
||||
{
|
||||
{
|
||||
.range_start = 46, .range_length = 13, .glyph_id_start = 1,
|
||||
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
|
||||
},
|
||||
{
|
||||
.range_start = 65, .range_length = 26, .glyph_id_start = 14,
|
||||
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
|
||||
},
|
||||
{
|
||||
.range_start = 97, .range_length = 26, .glyph_id_start = 40,
|
||||
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
|
||||
},
|
||||
{
|
||||
.range_start = 183, .range_length = 39458, .glyph_id_start = 66,
|
||||
.unicode_list = unicode_list_3, .glyph_id_ofs_list = NULL, .list_length = 12, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY
|
||||
}
|
||||
};
|
||||
|
||||
/*-----------------
|
||||
* KERNING
|
||||
*----------------*/
|
||||
|
||||
|
||||
/*Pair left and right glyphs for kerning*/
|
||||
static const uint8_t kern_pair_glyph_ids[] =
|
||||
{
|
||||
14, 16,
|
||||
14, 20,
|
||||
14, 23,
|
||||
14, 28,
|
||||
14, 33,
|
||||
14, 34,
|
||||
14, 35,
|
||||
14, 36,
|
||||
14, 38,
|
||||
14, 39,
|
||||
14, 59,
|
||||
14, 61,
|
||||
14, 62,
|
||||
14, 64,
|
||||
15, 33,
|
||||
15, 38,
|
||||
16, 16,
|
||||
16, 20,
|
||||
16, 28,
|
||||
16, 30,
|
||||
17, 1,
|
||||
17, 14,
|
||||
17, 33,
|
||||
17, 37,
|
||||
17, 39,
|
||||
18, 14,
|
||||
18, 23,
|
||||
18, 33,
|
||||
18, 36,
|
||||
18, 37,
|
||||
19, 1,
|
||||
19, 14,
|
||||
19, 23,
|
||||
19, 32,
|
||||
19, 33,
|
||||
19, 40,
|
||||
19, 45,
|
||||
20, 33,
|
||||
20, 35,
|
||||
20, 64,
|
||||
23, 1,
|
||||
23, 14,
|
||||
23, 23,
|
||||
23, 40,
|
||||
24, 16,
|
||||
24, 20,
|
||||
24, 23,
|
||||
24, 28,
|
||||
24, 30,
|
||||
24, 37,
|
||||
24, 39,
|
||||
24, 42,
|
||||
24, 43,
|
||||
24, 44,
|
||||
24, 46,
|
||||
24, 54,
|
||||
24, 56,
|
||||
24, 59,
|
||||
24, 61,
|
||||
24, 62,
|
||||
24, 64,
|
||||
25, 14,
|
||||
25, 16,
|
||||
25, 20,
|
||||
25, 23,
|
||||
25, 28,
|
||||
25, 30,
|
||||
25, 33,
|
||||
25, 34,
|
||||
25, 35,
|
||||
25, 36,
|
||||
25, 38,
|
||||
25, 39,
|
||||
25, 59,
|
||||
25, 61,
|
||||
25, 62,
|
||||
25, 64,
|
||||
28, 1,
|
||||
28, 14,
|
||||
28, 23,
|
||||
28, 33,
|
||||
28, 37,
|
||||
28, 38,
|
||||
28, 39,
|
||||
29, 1,
|
||||
29, 14,
|
||||
29, 20,
|
||||
29, 23,
|
||||
29, 36,
|
||||
29, 37,
|
||||
29, 40,
|
||||
29, 42,
|
||||
29, 43,
|
||||
29, 44,
|
||||
29, 46,
|
||||
29, 54,
|
||||
29, 56,
|
||||
30, 1,
|
||||
30, 14,
|
||||
30, 33,
|
||||
30, 37,
|
||||
30, 38,
|
||||
30, 39,
|
||||
31, 16,
|
||||
31, 20,
|
||||
31, 23,
|
||||
31, 28,
|
||||
31, 30,
|
||||
31, 33,
|
||||
31, 38,
|
||||
31, 42,
|
||||
31, 43,
|
||||
31, 44,
|
||||
31, 46,
|
||||
31, 54,
|
||||
31, 56,
|
||||
32, 59,
|
||||
32, 61,
|
||||
32, 62,
|
||||
32, 64,
|
||||
33, 1,
|
||||
33, 13,
|
||||
33, 14,
|
||||
33, 16,
|
||||
33, 20,
|
||||
33, 23,
|
||||
33, 28,
|
||||
33, 30,
|
||||
33, 33,
|
||||
33, 35,
|
||||
33, 36,
|
||||
33, 37,
|
||||
33, 38,
|
||||
33, 40,
|
||||
33, 42,
|
||||
33, 43,
|
||||
33, 44,
|
||||
33, 45,
|
||||
33, 46,
|
||||
33, 52,
|
||||
33, 53,
|
||||
33, 54,
|
||||
33, 55,
|
||||
33, 56,
|
||||
33, 57,
|
||||
33, 58,
|
||||
33, 60,
|
||||
33, 61,
|
||||
33, 62,
|
||||
33, 63,
|
||||
33, 64,
|
||||
33, 65,
|
||||
34, 14,
|
||||
35, 1,
|
||||
35, 14,
|
||||
35, 16,
|
||||
35, 20,
|
||||
35, 23,
|
||||
35, 28,
|
||||
35, 30,
|
||||
35, 32,
|
||||
35, 33,
|
||||
35, 40,
|
||||
35, 42,
|
||||
35, 43,
|
||||
35, 44,
|
||||
35, 46,
|
||||
35, 52,
|
||||
35, 53,
|
||||
35, 54,
|
||||
35, 55,
|
||||
35, 56,
|
||||
35, 57,
|
||||
35, 58,
|
||||
35, 60,
|
||||
36, 1,
|
||||
36, 14,
|
||||
36, 33,
|
||||
36, 40,
|
||||
36, 42,
|
||||
36, 43,
|
||||
36, 44,
|
||||
36, 46,
|
||||
36, 54,
|
||||
36, 56,
|
||||
37, 1,
|
||||
37, 16,
|
||||
37, 20,
|
||||
37, 23,
|
||||
37, 28,
|
||||
37, 30,
|
||||
37, 33,
|
||||
38, 1,
|
||||
38, 14,
|
||||
38, 16,
|
||||
38, 20,
|
||||
38, 23,
|
||||
38, 28,
|
||||
38, 30,
|
||||
38, 32,
|
||||
38, 33,
|
||||
38, 40,
|
||||
38, 42,
|
||||
38, 43,
|
||||
38, 44,
|
||||
38, 45,
|
||||
38, 46,
|
||||
38, 52,
|
||||
38, 53,
|
||||
38, 54,
|
||||
38, 55,
|
||||
38, 56,
|
||||
38, 57,
|
||||
38, 58,
|
||||
38, 60,
|
||||
39, 23,
|
||||
39, 33,
|
||||
39, 64,
|
||||
41, 40,
|
||||
41, 45,
|
||||
41, 63,
|
||||
42, 23,
|
||||
42, 33,
|
||||
42, 38,
|
||||
45, 1,
|
||||
45, 13,
|
||||
45, 41,
|
||||
45, 47,
|
||||
45, 59,
|
||||
45, 61,
|
||||
45, 62,
|
||||
45, 63,
|
||||
45, 64,
|
||||
46, 49,
|
||||
49, 49,
|
||||
50, 1,
|
||||
50, 13,
|
||||
50, 42,
|
||||
50, 43,
|
||||
50, 44,
|
||||
50, 46,
|
||||
50, 54,
|
||||
50, 56,
|
||||
50, 59,
|
||||
54, 40,
|
||||
54, 45,
|
||||
54, 63,
|
||||
55, 40,
|
||||
55, 45,
|
||||
55, 63,
|
||||
56, 49,
|
||||
57, 1,
|
||||
57, 13,
|
||||
57, 42,
|
||||
57, 43,
|
||||
57, 44,
|
||||
57, 45,
|
||||
57, 46,
|
||||
57, 52,
|
||||
57, 53,
|
||||
57, 54,
|
||||
57, 56,
|
||||
57, 58,
|
||||
57, 59,
|
||||
57, 61,
|
||||
57, 62,
|
||||
57, 63,
|
||||
57, 64,
|
||||
57, 65,
|
||||
59, 42,
|
||||
59, 43,
|
||||
59, 44,
|
||||
59, 46,
|
||||
59, 54,
|
||||
59, 56,
|
||||
59, 63,
|
||||
61, 1,
|
||||
61, 40,
|
||||
61, 42,
|
||||
61, 43,
|
||||
61, 44,
|
||||
61, 46,
|
||||
61, 54,
|
||||
61, 56,
|
||||
62, 1,
|
||||
62, 42,
|
||||
62, 43,
|
||||
62, 44,
|
||||
62, 46,
|
||||
62, 54,
|
||||
62, 56,
|
||||
63, 42,
|
||||
63, 43,
|
||||
63, 44,
|
||||
63, 46,
|
||||
63, 54,
|
||||
63, 56,
|
||||
64, 1,
|
||||
64, 42,
|
||||
64, 43,
|
||||
64, 44,
|
||||
64, 45,
|
||||
64, 46,
|
||||
64, 54,
|
||||
64, 56,
|
||||
64, 59
|
||||
};
|
||||
|
||||
/* Kerning between the respective left and right glyphs
|
||||
* 4.4 format which needs to scaled with `kern_scale`*/
|
||||
static const int8_t kern_pair_values[] =
|
||||
{
|
||||
-5, -5, 16, -5, -25, -5, -20, -12,
|
||||
-26, 10, -5, -7, -5, -6, -15, -11,
|
||||
-9, -9, -5, -9, -22, -6, -15, -9,
|
||||
-8, 2, 11, 1, 5, 1, -26, -22,
|
||||
-11, -5, 2, -13, 2, -8, -5, -5,
|
||||
-17, -6, -11, -5, -15, -15, 15, -15,
|
||||
-15, 6, 7, -5, -5, -5, -5, -5,
|
||||
-5, -8, -12, -9, -15, 10, -11, -11,
|
||||
17, -12, -12, -19, -5, -20, -8, -22,
|
||||
10, -5, -17, -11, -13, -15, -5, -2,
|
||||
-15, -6, -4, -8, -55, -27, -2, -22,
|
||||
7, -10, -11, -13, -13, -13, -13, -13,
|
||||
-12, -22, -5, -15, -6, -2, -8, -5,
|
||||
-5, 10, -3, -3, -9, -7, -9, -9,
|
||||
-10, -10, -10, -9, -11, -8, -5, -8,
|
||||
-30, -4, -26, -15, -15, -19, -15, -15,
|
||||
7, 7, 7, -1, 5, -37, -36, -36,
|
||||
-36, -16, -36, -30, -30, -36, -30, -36,
|
||||
-30, -26, -30, -17, -19, -30, -19, -22,
|
||||
-7, -39, -20, -7, -7, -12, -2, -7,
|
||||
-5, 7, -25, -22, -22, -22, -22, -13,
|
||||
-13, -22, -13, -22, -13, -11, -13, -22,
|
||||
-12, 7, -13, -8, -8, -8, -8, -8,
|
||||
-8, 10, -4, -4, 16, -4, -4, 6,
|
||||
-33, -27, -8, -8, -11, -8, -8, -5,
|
||||
7, -34, -30, -30, -30, -5, -30, -24,
|
||||
-24, -30, -24, -30, -24, -22, -24, 14,
|
||||
7, -9, -5, -2, -4, 12, -17, -13,
|
||||
-22, 14, 3, 3, 6, 7, 7, 3,
|
||||
6, 8, 6, 14, 14, -7, -5, -7,
|
||||
-7, -7, -5, -3, -5, -6, -4, -5,
|
||||
-6, -4, 17, -29, 14, -5, -5, -5,
|
||||
7, -5, -1, -1, -5, -5, 2, 10,
|
||||
14, 14, 10, 14, 7, -5, -5, -3,
|
||||
-3, -3, -3, 5, -22, -6, -2, -3,
|
||||
-2, -2, -2, -3, -17, -1, -2, -2,
|
||||
-1, -1, -2, -3, -3, -3, -3, -3,
|
||||
-3, -21, -2, -2, -2, 1, -2, -2,
|
||||
-2, 1
|
||||
};
|
||||
|
||||
/*Collect the kern pair's data in one place*/
|
||||
static const lv_font_fmt_txt_kern_pair_t kern_pairs =
|
||||
{
|
||||
.glyph_ids = kern_pair_glyph_ids,
|
||||
.values = kern_pair_values,
|
||||
.pair_cnt = 306,
|
||||
.glyph_ids_size = 0
|
||||
};
|
||||
|
||||
/*--------------------
|
||||
* ALL CUSTOM DATA
|
||||
*--------------------*/
|
||||
|
||||
#if LVGL_VERSION_MAJOR == 8
|
||||
/*Store all the custom data of the font*/
|
||||
static lv_font_fmt_txt_glyph_cache_t cache;
|
||||
#endif
|
||||
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
static const lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
#else
|
||||
static lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
#endif
|
||||
.glyph_bitmap = MXC_WRYH_bpp4_20px_glyph_bitmap,
|
||||
.glyph_dsc = MXC_WRYH_bpp4_20px_glyph_dsc,
|
||||
.cmaps = cmaps,
|
||||
.kern_dsc = &kern_pairs,
|
||||
.kern_scale = 16,
|
||||
.cmap_num = 4,
|
||||
.bpp = 4,
|
||||
.kern_classes = 0,
|
||||
.bitmap_format = 0,
|
||||
#if LVGL_VERSION_MAJOR == 8
|
||||
.cache = &cache
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
/*-----------------
|
||||
* PUBLIC FONT
|
||||
*----------------*/
|
||||
|
||||
/*Initialize a public general font descriptor*/
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
const lv_font_t MXC_WRYH_bpp4_20px = {
|
||||
#else
|
||||
lv_font_t MXC_WRYH_bpp4_20px = {
|
||||
#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 = 23, /*The maximum line height required by the font*/
|
||||
.base_line = 5, /*Baseline measured from the bottom of the line*/
|
||||
#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 = -2,
|
||||
.underline_thickness = 1,
|
||||
#endif
|
||||
.dsc = &font_dsc, /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
|
||||
.fallback = NULL,
|
||||
.user_data = NULL
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif /*#if MXC_WRYH_BPP4_20PX*/
|
||||
|
@ -0,0 +1,139 @@
|
||||
/*******************************************************************************
|
||||
* Size: 128 px
|
||||
* Bpp: 4
|
||||
* Opts: --no-compress --format lvgl --font HarmonyOS_Sans_SC_Medium.ttf -o Number_HarmonyOS_bpp4_128px.c --bpp 4 --size 128 -r 0x30-0x39 -r 0x2d-0x2f -r 0x3a -r 0x25 -r 0x47 -r 0x4F
|
||||
******************************************************************************/
|
||||
|
||||
#ifdef LV_LVGL_H_INCLUDE_SIMPLE
|
||||
#include "lvgl.h"
|
||||
#else
|
||||
#include "lvgl/lvgl.h"
|
||||
#endif
|
||||
|
||||
#ifndef NUMBER_HARMONYOS_BPP4_128PX
|
||||
#define NUMBER_HARMONYOS_BPP4_128PX 1
|
||||
#endif
|
||||
|
||||
#if NUMBER_HARMONYOS_BPP4_128PX
|
||||
|
||||
/*-----------------
|
||||
* BITMAPS
|
||||
*----------------*/
|
||||
|
||||
/*Store the image of the glyphs*/
|
||||
#include "bin_font.h"
|
||||
|
||||
/*---------------------
|
||||
* GLYPH DESCRIPTION
|
||||
*--------------------*/
|
||||
|
||||
|
||||
/*---------------------
|
||||
* CHARACTER MAPPING
|
||||
*--------------------*/
|
||||
|
||||
static const uint16_t unicode_list_0[] = {
|
||||
0x0, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe,
|
||||
0xf, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x22,
|
||||
0x2a
|
||||
};
|
||||
|
||||
/*Collect the unicode lists and glyph_id offsets*/
|
||||
static const lv_font_fmt_txt_cmap_t cmaps[] =
|
||||
{
|
||||
{
|
||||
.range_start = 37, .range_length = 43, .glyph_id_start = 1,
|
||||
.unicode_list = unicode_list_0, .glyph_id_ofs_list = NULL, .list_length = 17, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY
|
||||
}
|
||||
};
|
||||
|
||||
/*-----------------
|
||||
* KERNING
|
||||
*----------------*/
|
||||
|
||||
|
||||
/*Pair left and right glyphs for kerning*/
|
||||
static const uint8_t kern_pair_glyph_ids[] =
|
||||
{
|
||||
4, 2,
|
||||
4, 3,
|
||||
4, 4,
|
||||
4, 16,
|
||||
4, 17,
|
||||
16, 2,
|
||||
16, 3,
|
||||
17, 3,
|
||||
17, 4
|
||||
};
|
||||
|
||||
/* Kerning between the respective left and right glyphs
|
||||
* 4.4 format which needs to scaled with `kern_scale`*/
|
||||
static const int8_t kern_pair_values[] =
|
||||
{
|
||||
-37, -119, -77, -31, -31, 1, 15, -36,
|
||||
-30
|
||||
};
|
||||
|
||||
/*Collect the kern pair's data in one place*/
|
||||
static const lv_font_fmt_txt_kern_pair_t kern_pairs =
|
||||
{
|
||||
.glyph_ids = kern_pair_glyph_ids,
|
||||
.values = kern_pair_values,
|
||||
.pair_cnt = 9,
|
||||
.glyph_ids_size = 0
|
||||
};
|
||||
|
||||
/*--------------------
|
||||
* ALL CUSTOM DATA
|
||||
*--------------------*/
|
||||
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
/*Store all the custom data of the font*/
|
||||
static lv_font_fmt_txt_glyph_cache_t cache;
|
||||
static const lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
#else
|
||||
static lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
#endif
|
||||
.glyph_bitmap = Number_HarmonyOS_bpp4_128px_glyph_bitmap,
|
||||
.glyph_dsc = Number_HarmonyOS_bpp4_128px_glyph_dsc,
|
||||
.cmaps = cmaps,
|
||||
.kern_dsc = &kern_pairs,
|
||||
.kern_scale = 39,
|
||||
.cmap_num = 1,
|
||||
.bpp = 4,
|
||||
.kern_classes = 0,
|
||||
.bitmap_format = 0,
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
.cache = &cache
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
/*-----------------
|
||||
* PUBLIC FONT
|
||||
*----------------*/
|
||||
|
||||
/*Initialize a public general font descriptor*/
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
const lv_font_t Number_HarmonyOS_bpp4_128px = {
|
||||
#else
|
||||
lv_font_t Number_HarmonyOS_bpp4_128px = {
|
||||
#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 = 98, /*The maximum line height required by the font*/
|
||||
.base_line = 2, /*Baseline measured from the bottom of the line*/
|
||||
#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 = -10,
|
||||
.underline_thickness = 6,
|
||||
#endif
|
||||
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif /*#if NUMBER_HARMONYOS_BPP4_128PX*/
|
||||
|
@ -0,0 +1,309 @@
|
||||
/*******************************************************************************
|
||||
* Size: 12 px
|
||||
* Bpp: 4
|
||||
* Opts: --no-compress --format lvgl --font HarmonyOS_Sans_SC_Medium.ttf -o Number_HarmonyOS_bpp4_12px.c --bpp 4 --size 12 -r 0x20-0x7f
|
||||
******************************************************************************/
|
||||
|
||||
#ifdef LV_LVGL_H_INCLUDE_SIMPLE
|
||||
#include "lvgl.h"
|
||||
#else
|
||||
#include "lvgl/lvgl.h"
|
||||
#endif
|
||||
|
||||
#ifndef NUMBER_HARMONYOS_BPP4_12PX
|
||||
#define NUMBER_HARMONYOS_BPP4_12PX 1
|
||||
#endif
|
||||
|
||||
#if NUMBER_HARMONYOS_BPP4_12PX
|
||||
|
||||
/*-----------------
|
||||
* BITMAPS
|
||||
*----------------*/
|
||||
|
||||
/*Store the image of the glyphs*/
|
||||
#include "bin_font.h"
|
||||
|
||||
/*---------------------
|
||||
* GLYPH DESCRIPTION
|
||||
*--------------------*/
|
||||
|
||||
|
||||
/*---------------------
|
||||
* CHARACTER MAPPING
|
||||
*--------------------*/
|
||||
|
||||
|
||||
|
||||
/*Collect the unicode lists and glyph_id offsets*/
|
||||
static const lv_font_fmt_txt_cmap_t cmaps[] =
|
||||
{
|
||||
{
|
||||
.range_start = 32, .range_length = 95, .glyph_id_start = 1,
|
||||
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
|
||||
}
|
||||
};
|
||||
|
||||
/*-----------------
|
||||
* KERNING
|
||||
*----------------*/
|
||||
|
||||
|
||||
/*Map glyph_ids to kern left classes*/
|
||||
static const uint8_t kern_left_class_mapping[] =
|
||||
{
|
||||
0, 0, 0, 1, 0, 0, 0, 0,
|
||||
1, 2, 3, 0, 4, 0, 4, 0,
|
||||
5, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 4,
|
||||
6, 7, 8, 9, 10, 7, 11, 12,
|
||||
13, 14, 14, 15, 16, 17, 14, 14,
|
||||
7, 18, 0, 19, 20, 21, 15, 5,
|
||||
22, 23, 24, 25, 2, 8, 3, 0,
|
||||
0, 0, 26, 27, 28, 29, 30, 31,
|
||||
32, 26, 0, 33, 34, 29, 26, 26,
|
||||
27, 27, 0, 35, 36, 37, 32, 38,
|
||||
38, 39, 38, 40, 2, 0, 3, 4
|
||||
};
|
||||
|
||||
/*Map glyph_ids to kern right classes*/
|
||||
static const uint8_t kern_right_class_mapping[] =
|
||||
{
|
||||
0, 1, 0, 2, 0, 0, 0, 0,
|
||||
2, 0, 3, 0, 4, 5, 4, 5,
|
||||
6, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 4, 0, 0,
|
||||
7, 8, 6, 9, 8, 9, 9, 9,
|
||||
8, 9, 9, 10, 9, 9, 9, 9,
|
||||
8, 9, 8, 9, 11, 12, 13, 14,
|
||||
15, 16, 17, 18, 0, 14, 3, 0,
|
||||
5, 0, 19, 20, 21, 21, 21, 22,
|
||||
21, 20, 0, 23, 20, 20, 24, 24,
|
||||
21, 0, 21, 24, 25, 26, 27, 28,
|
||||
28, 29, 30, 31, 0, 0, 3, 4
|
||||
};
|
||||
|
||||
/*Kern values between classes*/
|
||||
static const int8_t kern_class_values[] =
|
||||
{
|
||||
0, 0, 0, 0, 0, 0, 3, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 4, 0, 4, 4,
|
||||
2, 0, 3, 0, 0, 13, 0, 0,
|
||||
3, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 5, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, -10, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, -8, 3, 4, -8,
|
||||
-27, -18, 4, -7, 0, -23, -2, 4,
|
||||
0, 0, 0, 0, 0, 0, -15, 0,
|
||||
-14, -5, 0, -9, -11, -1, -9, -9,
|
||||
-11, -9, -10, 0, 0, 0, -6, -19,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, -4, 0, 0, -8, -7,
|
||||
0, 0, 0, -7, 0, -6, 0, -7,
|
||||
-4, -7, -11, -4, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, -8, -22, 0, -12, 5, 0, -13,
|
||||
-7, 0, 0, 0, -16, -3, -18, -13,
|
||||
0, -21, 4, 0, 0, -2, 0, 0,
|
||||
0, 0, 0, 0, -8, 0, -8, 0,
|
||||
0, -2, 0, 0, 0, -3, 0, 0,
|
||||
0, 3, 0, -7, 0, -9, -3, 0,
|
||||
-11, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
2, 0, -6, 4, 0, 6, -3, 0,
|
||||
0, 0, 1, 0, -1, 0, 0, -1,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, -4, 0, -4, 0, 0, 0,
|
||||
0, 0, 2, 0, 2, -2, 0, 2,
|
||||
0, 0, 0, -2, 0, 0, -2, 0,
|
||||
-2, 0, -2, -3, 0, 0, -2, -2,
|
||||
-2, -4, -2, -4, 0, -2, 5, 0,
|
||||
1, -25, -11, 8, -1, 0, -27, 0,
|
||||
4, 0, 0, 0, 0, 0, 0, -8,
|
||||
0, -5, -2, 0, -3, 0, -2, 0,
|
||||
-4, -7, -4, -5, 0, 0, 0, 0,
|
||||
3, 0, 2, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 1, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, -6, -3,
|
||||
0, 0, 0, -6, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, -8, 0, 0, -21, 3, 0, -1,
|
||||
-11, -3, 0, -3, 0, -5, 0, 0,
|
||||
0, 0, 0, -6, 0, -7, -8, 0,
|
||||
-3, -3, -8, -8, -13, -7, -13, 0,
|
||||
-10, -20, 0, -17, 5, 0, -14, -9,
|
||||
0, 3, -2, -25, -8, -28, -21, 0,
|
||||
-34, 0, -1, 0, -4, -4, 0, 0,
|
||||
0, -5, -5, -18, 0, -18, 0, -2,
|
||||
2, 0, 2, -28, -16, 3, 0, 0,
|
||||
-31, 0, 0, 0, -1, -1, -5, 0,
|
||||
-6, -6, 0, -6, 0, 0, 0, 0,
|
||||
0, 0, 2, 0, 2, 0, 0, -2,
|
||||
0, -2, 7, 0, -1, -2, 0, 0,
|
||||
1, -2, -2, -5, -3, 0, -9, 0,
|
||||
0, 0, -2, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 2, 0, 0, 0, 4,
|
||||
0, 0, -3, 0, 0, -4, 1, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, -6, 6, 0, -15,
|
||||
-22, -16, 7, -6, 0, -27, 0, 4,
|
||||
0, 4, 4, 0, 0, 0, -23, 0,
|
||||
-21, -9, 0, -18, -21, -6, -17, -20,
|
||||
-21, -20, -17, -2, 3, 0, -5, -15,
|
||||
-13, 0, -4, 0, -14, 0, 4, 0,
|
||||
0, 0, 0, 0, 0, -15, 0, -12,
|
||||
-3, 0, -8, -9, 0, -7, -4, -6,
|
||||
-4, -7, 0, 0, 4, -18, 2, 0,
|
||||
2, -7, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, -5, 0, -7, 0,
|
||||
0, -3, -3, -6, -6, -12, 0, -12,
|
||||
0, -6, 3, 4, -14, -26, -21, 2,
|
||||
-11, 0, -26, -5, 0, 0, 0, 0,
|
||||
0, 0, 0, -22, 0, -21, -10, 0,
|
||||
-16, -18, -7, -15, -14, -13, -14, -15,
|
||||
0, 0, 2, -9, 4, 0, 2, -5,
|
||||
0, 0, -2, 0, 0, 0, 0, 0,
|
||||
0, 0, -1, 0, -3, 0, 0, 0,
|
||||
0, 0, 0, -6, 0, -6, 0, 0,
|
||||
-8, 0, 0, 0, 0, -6, 0, 0,
|
||||
0, 0, -17, 0, -14, -13, -2, -19,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, -2, 0, -2, 0, 0, -10,
|
||||
0, -2, -6, 0, -8, 0, 0, 0,
|
||||
0, -21, 0, -14, -12, -7, -21, 0,
|
||||
-2, 0, 0, -2, 0, 0, 0, -1,
|
||||
0, -4, -5, -4, -4, 0, 1, 0,
|
||||
3, 5, 0, -2, 0, 0, 0, 0,
|
||||
-15, 0, -10, -7, 3, -15, 0, 0,
|
||||
0, -1, 2, 0, 0, 0, 4, 0,
|
||||
0, 1, 0, 3, 0, 0, 3, 0,
|
||||
0, 0, 2, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, -1, 0, 3, -1,
|
||||
0, -5, 0, 0, 0, 0, -14, 0,
|
||||
-12, -9, -3, -18, 0, 0, 0, 0,
|
||||
0, 0, 0, 2, 0, 0, 0, -1,
|
||||
0, 0, 0, 9, 0, -1, -15, 0,
|
||||
9, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, -5, 0, -5, 0,
|
||||
0, 0, 0, 3, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, -5,
|
||||
0, 0, 0, 0, -18, 0, -9, -8,
|
||||
0, -16, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 2, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 8, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, -4,
|
||||
0, 0, -5, 5, 0, -9, 0, 0,
|
||||
0, 0, -18, 0, -12, -11, 0, -16,
|
||||
0, -6, 0, -4, 0, 0, 0, -2,
|
||||
0, -2, 0, 0, 0, 0, 0, 5,
|
||||
0, 2, -21, -9, -6, 0, 0, -23,
|
||||
0, 0, 0, -8, 0, -10, -14, 0,
|
||||
-8, 0, -6, 0, 0, 0, -1, 6,
|
||||
0, 0, 0, 0, 0, 0, -6, 0,
|
||||
0, 0, 0, -6, 0, 0, 0, 0,
|
||||
-19, 0, -14, -10, -1, -20, 0, 0,
|
||||
0, 0, 0, 0, 0, 2, 0, 0,
|
||||
-2, 0, -2, 2, 0, -1, 2, 0,
|
||||
5, 0, -5, 0, 0, 0, 0, -13,
|
||||
0, -9, 0, 0, -13, 0, 0, 0,
|
||||
-2, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, -17,
|
||||
-8, -5, 0, 0, -15, 0, -20, 0,
|
||||
-9, -4, -12, -14, 0, -4, 0, -4,
|
||||
0, 0, 0, -2, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, -4, 2, 0,
|
||||
-8, 0, 0, 0, 0, -21, 0, -11,
|
||||
-6, 0, -13, 0, -3, 0, -5, 0,
|
||||
0, 0, 0, 2, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 2, 0, -6,
|
||||
0, 0, 0, 0, -19, 0, -11, -6,
|
||||
0, -14, 0, -3, 0, -4, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0
|
||||
};
|
||||
|
||||
|
||||
/*Collect the kern class' data in one place*/
|
||||
static const lv_font_fmt_txt_kern_classes_t kern_classes =
|
||||
{
|
||||
.class_pair_values = kern_class_values,
|
||||
.left_class_mapping = kern_left_class_mapping,
|
||||
.right_class_mapping = kern_right_class_mapping,
|
||||
.left_class_cnt = 40,
|
||||
.right_class_cnt = 31,
|
||||
};
|
||||
|
||||
/*--------------------
|
||||
* ALL CUSTOM DATA
|
||||
*--------------------*/
|
||||
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
/*Store all the custom data of the font*/
|
||||
static lv_font_fmt_txt_glyph_cache_t cache;
|
||||
static const lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
#else
|
||||
static lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
#endif
|
||||
.glyph_bitmap = Number_HarmonyOS_bpp4_12px_glyph_bitmap,
|
||||
.glyph_dsc = Number_HarmonyOS_bpp4_12px_glyph_dsc,
|
||||
.cmaps = cmaps,
|
||||
.kern_dsc = &kern_classes,
|
||||
.kern_scale = 16,
|
||||
.cmap_num = 1,
|
||||
.bpp = 4,
|
||||
.kern_classes = 1,
|
||||
.bitmap_format = 0,
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
.cache = &cache
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
/*-----------------
|
||||
* PUBLIC FONT
|
||||
*----------------*/
|
||||
|
||||
/*Initialize a public general font descriptor*/
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
const lv_font_t Number_HarmonyOS_bpp4_12px = {
|
||||
#else
|
||||
lv_font_t Number_HarmonyOS_bpp4_12px = {
|
||||
#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 = 15, /*The maximum line height required by the font*/
|
||||
.base_line = 3, /*Baseline measured from the bottom of the line*/
|
||||
#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 = -1,
|
||||
.underline_thickness = 1,
|
||||
#endif
|
||||
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif /*#if NUMBER_HARMONYOS_BPP4_12PX*/
|
||||
|
@ -0,0 +1,309 @@
|
||||
/*******************************************************************************
|
||||
* Size: 16 px
|
||||
* Bpp: 4
|
||||
* Opts: --no-compress --format lvgl --font HarmonyOS_Sans_SC_Medium.ttf -o Number_HarmonyOS_bpp4_16px.c --bpp 4 --size 16 -r 0x20-0x7f
|
||||
******************************************************************************/
|
||||
|
||||
#ifdef LV_LVGL_H_INCLUDE_SIMPLE
|
||||
#include "lvgl.h"
|
||||
#else
|
||||
#include "lvgl/lvgl.h"
|
||||
#endif
|
||||
|
||||
#ifndef NUMBER_HARMONYOS_BPP4_16PX
|
||||
#define NUMBER_HARMONYOS_BPP4_16PX 1
|
||||
#endif
|
||||
|
||||
#if NUMBER_HARMONYOS_BPP4_16PX
|
||||
|
||||
/*-----------------
|
||||
* BITMAPS
|
||||
*----------------*/
|
||||
|
||||
/*Store the image of the glyphs*/
|
||||
#include "bin_font.h"
|
||||
|
||||
/*---------------------
|
||||
* GLYPH DESCRIPTION
|
||||
*--------------------*/
|
||||
|
||||
|
||||
/*---------------------
|
||||
* CHARACTER MAPPING
|
||||
*--------------------*/
|
||||
|
||||
|
||||
|
||||
/*Collect the unicode lists and glyph_id offsets*/
|
||||
static const lv_font_fmt_txt_cmap_t cmaps[] =
|
||||
{
|
||||
{
|
||||
.range_start = 32, .range_length = 95, .glyph_id_start = 1,
|
||||
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
|
||||
}
|
||||
};
|
||||
|
||||
/*-----------------
|
||||
* KERNING
|
||||
*----------------*/
|
||||
|
||||
|
||||
/*Map glyph_ids to kern left classes*/
|
||||
static const uint8_t kern_left_class_mapping[] =
|
||||
{
|
||||
0, 0, 0, 1, 0, 0, 0, 0,
|
||||
1, 2, 3, 0, 4, 0, 4, 0,
|
||||
5, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 4,
|
||||
6, 7, 8, 9, 10, 7, 11, 12,
|
||||
13, 14, 14, 15, 16, 17, 14, 14,
|
||||
7, 18, 0, 19, 20, 21, 15, 5,
|
||||
22, 23, 24, 25, 2, 8, 3, 0,
|
||||
0, 0, 26, 27, 28, 29, 30, 31,
|
||||
32, 26, 0, 33, 34, 29, 26, 26,
|
||||
27, 27, 0, 35, 36, 37, 32, 38,
|
||||
38, 39, 38, 40, 2, 0, 3, 4
|
||||
};
|
||||
|
||||
/*Map glyph_ids to kern right classes*/
|
||||
static const uint8_t kern_right_class_mapping[] =
|
||||
{
|
||||
0, 1, 0, 2, 0, 0, 0, 0,
|
||||
2, 0, 3, 0, 4, 5, 4, 5,
|
||||
6, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 4, 0, 0,
|
||||
7, 8, 6, 9, 8, 9, 9, 9,
|
||||
8, 9, 9, 10, 9, 9, 9, 9,
|
||||
8, 9, 8, 9, 11, 12, 13, 14,
|
||||
15, 16, 17, 18, 0, 14, 3, 0,
|
||||
5, 0, 19, 20, 21, 21, 21, 22,
|
||||
21, 20, 0, 23, 20, 20, 24, 24,
|
||||
21, 0, 21, 24, 25, 26, 27, 28,
|
||||
28, 29, 30, 31, 0, 0, 3, 4
|
||||
};
|
||||
|
||||
/*Kern values between classes*/
|
||||
static const int8_t kern_class_values[] =
|
||||
{
|
||||
0, 0, 0, 0, 0, 0, 4, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 5, 0, 5, 5,
|
||||
3, 0, 4, 0, 0, 18, 0, 0,
|
||||
5, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 6, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, -14, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, -10, 5, 5, -11,
|
||||
-36, -24, 6, -9, 0, -31, -3, 5,
|
||||
0, 0, 0, 0, 0, 0, -19, 0,
|
||||
-19, -6, 0, -12, -15, -2, -12, -12,
|
||||
-14, -12, -14, 0, 0, 0, -8, -26,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, -6, 0, 0, -11, -9,
|
||||
0, 0, 0, -9, 0, -8, 0, -9,
|
||||
-5, -9, -14, -6, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, -10, -30, 0, -16, 7, 0, -17,
|
||||
-9, 0, 0, 0, -22, -4, -24, -18,
|
||||
0, -28, 5, 0, 0, -3, 0, 0,
|
||||
0, 0, 0, 0, -11, 0, -11, 0,
|
||||
0, -3, 0, 0, 0, -4, 0, 0,
|
||||
0, 4, 0, -9, 0, -12, -4, 0,
|
||||
-15, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
3, 0, -8, 6, 0, 8, -4, 0,
|
||||
0, 0, 1, 0, -1, 0, 0, -1,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, -6, 0, -6, 0, 0, 0,
|
||||
0, 0, 3, 0, 3, -3, 0, 3,
|
||||
0, 0, 0, -3, 0, 0, -3, 0,
|
||||
-3, 0, -3, -4, 0, 0, -2, -3,
|
||||
-2, -5, -2, -5, 0, -3, 7, 0,
|
||||
2, -34, -15, 10, -1, 0, -36, 0,
|
||||
6, 0, 0, 0, 0, 0, 0, -10,
|
||||
0, -7, -2, 0, -5, 0, -3, 0,
|
||||
-6, -9, -6, -6, 0, 0, 0, 0,
|
||||
5, 0, 3, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 2, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, -8, -4,
|
||||
0, 0, 0, -8, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, -10, 0, 0, -28, 5, 0, -2,
|
||||
-15, -4, 0, -4, 0, -7, 0, 0,
|
||||
0, 0, 0, -7, 0, -9, -10, 0,
|
||||
-4, -4, -10, -11, -17, -9, -17, 0,
|
||||
-13, -26, 0, -23, 7, 0, -18, -12,
|
||||
0, 4, -2, -34, -11, -38, -28, 0,
|
||||
-46, 0, -2, 0, -5, -5, 0, -1,
|
||||
0, -7, -7, -24, 0, -24, 0, -3,
|
||||
3, 0, 3, -37, -21, 4, 0, 0,
|
||||
-41, 0, 0, 0, -1, -1, -6, 0,
|
||||
-8, -8, 0, -8, 0, 0, 0, 0,
|
||||
0, 0, 3, 0, 3, 0, 0, -3,
|
||||
0, -2, 10, 0, -1, -3, 0, 0,
|
||||
2, -3, -3, -7, -5, 0, -13, 0,
|
||||
0, 0, -3, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 2, 0, 0, 0, 6,
|
||||
0, 0, -4, 0, 0, -6, 2, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, -8, 8, 0, -20,
|
||||
-29, -22, 9, -8, 0, -36, 0, 6,
|
||||
0, 5, 5, 0, 0, 0, -30, 0,
|
||||
-28, -12, 0, -24, -28, -8, -23, -27,
|
||||
-27, -27, -22, -3, 5, 0, -6, -20,
|
||||
-18, 0, -5, 0, -19, -1, 5, 0,
|
||||
0, 0, 0, 0, 0, -20, 0, -16,
|
||||
-4, 0, -11, -12, 0, -9, -6, -8,
|
||||
-6, -9, 0, 0, 5, -24, 3, 0,
|
||||
3, -9, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, -6, 0, -9, 0,
|
||||
0, -4, -5, -8, -8, -16, 0, -16,
|
||||
0, -8, 4, 5, -18, -35, -28, 2,
|
||||
-14, 0, -35, -6, 0, 0, 0, 0,
|
||||
0, 0, 0, -29, 0, -27, -13, 0,
|
||||
-22, -24, -9, -20, -19, -18, -19, -20,
|
||||
0, 0, 3, -12, 5, 0, 3, -7,
|
||||
0, 0, -3, 0, 0, 0, 0, 0,
|
||||
0, 0, -1, 0, -4, 0, 0, 0,
|
||||
0, 0, 0, -8, 0, -8, 0, 0,
|
||||
-10, 0, -1, 0, 0, -8, 0, 0,
|
||||
0, 0, -22, 0, -19, -17, -2, -26,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, -3, 0, -3, 0, 0, -13,
|
||||
0, -3, -8, 0, -10, 0, 0, 0,
|
||||
0, -28, 0, -19, -16, -9, -27, 0,
|
||||
-3, 0, 0, -2, 0, 0, 0, -1,
|
||||
0, -5, -6, -5, -6, 0, 1, 0,
|
||||
5, 6, 0, -3, 0, 0, 0, 0,
|
||||
-20, 0, -13, -9, 5, -20, 0, 1,
|
||||
0, -1, 3, 0, 0, 0, 6, 0,
|
||||
0, 2, 0, 4, 0, 0, 4, 0,
|
||||
0, 0, 3, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, -1, 0, 4, -1,
|
||||
0, -6, 0, 0, 0, 0, -18, 0,
|
||||
-17, -13, -4, -24, 0, 0, 0, 0,
|
||||
0, 0, 0, 3, 0, 0, -1, -2,
|
||||
-1, 0, 0, 12, 0, -2, -20, 0,
|
||||
12, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, -7, 0, -6, 1,
|
||||
0, 0, 0, 4, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, -7,
|
||||
0, 0, 0, 0, -24, 0, -12, -11,
|
||||
0, -22, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 3, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 11, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, -6,
|
||||
0, 0, -7, 6, 0, -12, 0, 0,
|
||||
0, 0, -24, 0, -16, -14, 0, -22,
|
||||
0, -7, 0, -6, 0, 0, 0, -3,
|
||||
0, -2, 0, 0, 0, 0, 0, 6,
|
||||
0, 2, -28, -12, -7, 0, 0, -30,
|
||||
0, 0, 0, -11, 0, -13, -19, 0,
|
||||
-11, 0, -8, 0, 0, 0, -2, 7,
|
||||
0, 0, 0, 0, 0, 0, -7, 0,
|
||||
0, 0, 0, -8, 0, 0, 0, 0,
|
||||
-26, 0, -18, -13, -1, -27, 0, 0,
|
||||
0, 0, 0, 0, 0, 2, 0, 0,
|
||||
-2, 0, -2, 3, 0, -2, 3, -1,
|
||||
7, 0, -6, 0, 0, 0, 0, -18,
|
||||
0, -12, 0, -1, -17, 0, 0, 0,
|
||||
-2, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, -23,
|
||||
-11, -7, 0, 0, -20, 0, -27, 0,
|
||||
-12, -6, -16, -19, 0, -5, 0, -5,
|
||||
0, 0, 0, -3, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, -5, 2, 0,
|
||||
-10, 0, 0, 0, 0, -27, 0, -14,
|
||||
-8, 0, -18, 0, -4, 0, -6, 0,
|
||||
0, 0, 0, 3, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 3, 0, -8,
|
||||
0, 0, 0, 0, -25, 0, -14, -8,
|
||||
0, -19, 0, -4, 0, -6, 0, 0,
|
||||
0, 1, 0, 0, 0, 0, 0, 0
|
||||
};
|
||||
|
||||
|
||||
/*Collect the kern class' data in one place*/
|
||||
static const lv_font_fmt_txt_kern_classes_t kern_classes =
|
||||
{
|
||||
.class_pair_values = kern_class_values,
|
||||
.left_class_mapping = kern_left_class_mapping,
|
||||
.right_class_mapping = kern_right_class_mapping,
|
||||
.left_class_cnt = 40,
|
||||
.right_class_cnt = 31,
|
||||
};
|
||||
|
||||
/*--------------------
|
||||
* ALL CUSTOM DATA
|
||||
*--------------------*/
|
||||
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
/*Store all the custom data of the font*/
|
||||
static lv_font_fmt_txt_glyph_cache_t cache;
|
||||
static const lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
#else
|
||||
static lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
#endif
|
||||
.glyph_bitmap = Number_HarmonyOS_bpp4_16px_glyph_bitmap,
|
||||
.glyph_dsc = Number_HarmonyOS_bpp4_16px_glyph_dsc,
|
||||
.cmaps = cmaps,
|
||||
.kern_dsc = &kern_classes,
|
||||
.kern_scale = 16,
|
||||
.cmap_num = 1,
|
||||
.bpp = 4,
|
||||
.kern_classes = 1,
|
||||
.bitmap_format = 0,
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
.cache = &cache
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
/*-----------------
|
||||
* PUBLIC FONT
|
||||
*----------------*/
|
||||
|
||||
/*Initialize a public general font descriptor*/
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
const lv_font_t Number_HarmonyOS_bpp4_16px = {
|
||||
#else
|
||||
lv_font_t Number_HarmonyOS_bpp4_16px = {
|
||||
#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 = 19, /*The maximum line height required by the font*/
|
||||
.base_line = 4, /*Baseline measured from the bottom of the line*/
|
||||
#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 = -1,
|
||||
.underline_thickness = 1,
|
||||
#endif
|
||||
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif /*#if NUMBER_HARMONYOS_BPP4_16PX*/
|
||||
|
@ -0,0 +1,128 @@
|
||||
/*******************************************************************************
|
||||
* Size: 180 px
|
||||
* Bpp: 4
|
||||
* Opts: --no-compress --format lvgl --font HarmonyOS_Sans_SC_Medium.ttf -o Number_HarmonyOS_bpp4_180px.c --bpp 4 --size 180 -r 0x30-0x39 -r 0x2d-0x2f -r 0x3a
|
||||
******************************************************************************/
|
||||
|
||||
#ifdef LV_LVGL_H_INCLUDE_SIMPLE
|
||||
#include "lvgl.h"
|
||||
#else
|
||||
#include "lvgl/lvgl.h"
|
||||
#endif
|
||||
|
||||
#ifndef NUMBER_HARMONYOS_BPP4_180PX
|
||||
#define NUMBER_HARMONYOS_BPP4_180PX 1
|
||||
#endif
|
||||
|
||||
#if NUMBER_HARMONYOS_BPP4_180PX
|
||||
|
||||
/*-----------------
|
||||
* BITMAPS
|
||||
*----------------*/
|
||||
|
||||
/*Store the image of the glyphs*/
|
||||
#include "bin_font.h"
|
||||
|
||||
/*---------------------
|
||||
* GLYPH DESCRIPTION
|
||||
*--------------------*/
|
||||
|
||||
|
||||
/*---------------------
|
||||
* CHARACTER MAPPING
|
||||
*--------------------*/
|
||||
|
||||
|
||||
|
||||
/*Collect the unicode lists and glyph_id offsets*/
|
||||
static const lv_font_fmt_txt_cmap_t cmaps[] =
|
||||
{
|
||||
{
|
||||
.range_start = 45, .range_length = 14, .glyph_id_start = 1,
|
||||
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
|
||||
}
|
||||
};
|
||||
|
||||
/*-----------------
|
||||
* KERNING
|
||||
*----------------*/
|
||||
|
||||
|
||||
/*Pair left and right glyphs for kerning*/
|
||||
static const uint8_t kern_pair_glyph_ids[] =
|
||||
{
|
||||
3, 1,
|
||||
3, 2,
|
||||
3, 3
|
||||
};
|
||||
|
||||
/* Kerning between the respective left and right glyphs
|
||||
* 4.4 format which needs to scaled with `kern_scale`*/
|
||||
static const int8_t kern_pair_values[] =
|
||||
{
|
||||
-37, -119, -77
|
||||
};
|
||||
|
||||
/*Collect the kern pair's data in one place*/
|
||||
static const lv_font_fmt_txt_kern_pair_t kern_pairs =
|
||||
{
|
||||
.glyph_ids = kern_pair_glyph_ids,
|
||||
.values = kern_pair_values,
|
||||
.pair_cnt = 3,
|
||||
.glyph_ids_size = 0
|
||||
};
|
||||
|
||||
/*--------------------
|
||||
* ALL CUSTOM DATA
|
||||
*--------------------*/
|
||||
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
/*Store all the custom data of the font*/
|
||||
static lv_font_fmt_txt_glyph_cache_t cache;
|
||||
static const lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
#else
|
||||
static lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
#endif
|
||||
.glyph_bitmap = Number_HarmonyOS_bpp4_180px_glyph_bitmap,
|
||||
.glyph_dsc = Number_HarmonyOS_bpp4_180px_glyph_dsc,
|
||||
.cmaps = cmaps,
|
||||
.kern_dsc = &kern_pairs,
|
||||
.kern_scale = 55,
|
||||
.cmap_num = 1,
|
||||
.bpp = 4,
|
||||
.kern_classes = 0,
|
||||
.bitmap_format = 0,
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
.cache = &cache
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
/*-----------------
|
||||
* PUBLIC FONT
|
||||
*----------------*/
|
||||
|
||||
/*Initialize a public general font descriptor*/
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
const lv_font_t Number_HarmonyOS_bpp4_180px = {
|
||||
#else
|
||||
lv_font_t Number_HarmonyOS_bpp4_180px = {
|
||||
#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 = 137, /*The maximum line height required by the font*/
|
||||
.base_line = 2, /*Baseline measured from the bottom of the line*/
|
||||
#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 = -13,
|
||||
.underline_thickness = 9,
|
||||
#endif
|
||||
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif /*#if NUMBER_HARMONYOS_BPP4_180PX*/
|
||||
|
@ -0,0 +1,315 @@
|
||||
/*******************************************************************************
|
||||
* Size: 20 px
|
||||
* Bpp: 4
|
||||
* Opts: --no-compress --format lvgl --font HarmonyOS_Sans_SC_Medium.ttf -o Number_HarmonyOS_bpp4_20px.c --bpp 4 --size 20 -r 0x00-0x7f
|
||||
******************************************************************************/
|
||||
|
||||
#ifdef LV_LVGL_H_INCLUDE_SIMPLE
|
||||
#include "lvgl.h"
|
||||
#else
|
||||
#include "lvgl/lvgl.h"
|
||||
#endif
|
||||
|
||||
#ifndef NUMBER_HARMONYOS_BPP4_20PX
|
||||
#define NUMBER_HARMONYOS_BPP4_20PX 1
|
||||
#endif
|
||||
|
||||
#if NUMBER_HARMONYOS_BPP4_20PX
|
||||
|
||||
/*-----------------
|
||||
* BITMAPS
|
||||
*----------------*/
|
||||
|
||||
/*Store the image of the glyphs*/
|
||||
#include "bin_font.h"
|
||||
|
||||
/*---------------------
|
||||
* GLYPH DESCRIPTION
|
||||
*--------------------*/
|
||||
|
||||
|
||||
/*---------------------
|
||||
* CHARACTER MAPPING
|
||||
*--------------------*/
|
||||
|
||||
|
||||
|
||||
/*Collect the unicode lists and glyph_id offsets*/
|
||||
static const lv_font_fmt_txt_cmap_t cmaps[] =
|
||||
{
|
||||
{
|
||||
.range_start = 0, .range_length = 1, .glyph_id_start = 1,
|
||||
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
|
||||
},
|
||||
{
|
||||
.range_start = 32, .range_length = 95, .glyph_id_start = 2,
|
||||
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
|
||||
}
|
||||
};
|
||||
|
||||
/*-----------------
|
||||
* KERNING
|
||||
*----------------*/
|
||||
|
||||
|
||||
/*Map glyph_ids to kern left classes*/
|
||||
static const uint8_t kern_left_class_mapping[] =
|
||||
{
|
||||
0, 0, 0, 0, 1, 0, 0, 0,
|
||||
0, 1, 2, 3, 0, 4, 0, 4,
|
||||
0, 5, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
4, 6, 7, 8, 9, 10, 7, 11,
|
||||
12, 13, 14, 14, 15, 16, 17, 14,
|
||||
14, 7, 18, 0, 19, 20, 21, 15,
|
||||
5, 22, 23, 24, 25, 2, 8, 3,
|
||||
0, 0, 0, 26, 27, 28, 29, 30,
|
||||
31, 32, 26, 0, 33, 34, 29, 26,
|
||||
26, 27, 27, 0, 35, 36, 37, 32,
|
||||
38, 38, 39, 38, 40, 2, 0, 3,
|
||||
4
|
||||
};
|
||||
|
||||
/*Map glyph_ids to kern right classes*/
|
||||
static const uint8_t kern_right_class_mapping[] =
|
||||
{
|
||||
0, 0, 1, 0, 2, 0, 0, 0,
|
||||
0, 2, 0, 3, 0, 4, 5, 4,
|
||||
5, 6, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 4, 0,
|
||||
0, 7, 8, 6, 9, 8, 9, 9,
|
||||
9, 8, 9, 9, 10, 9, 9, 9,
|
||||
9, 8, 9, 8, 9, 11, 12, 13,
|
||||
14, 15, 16, 17, 18, 0, 14, 3,
|
||||
0, 5, 0, 19, 20, 21, 21, 21,
|
||||
22, 21, 20, 0, 23, 20, 20, 24,
|
||||
24, 21, 0, 21, 24, 25, 26, 27,
|
||||
28, 28, 29, 30, 31, 0, 0, 3,
|
||||
4
|
||||
};
|
||||
|
||||
/*Kern values between classes*/
|
||||
static const int8_t kern_class_values[] =
|
||||
{
|
||||
0, 0, 0, 0, 0, 0, 5, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 6, 0, 6, 6,
|
||||
3, 0, 4, 0, 0, 22, 0, 0,
|
||||
6, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 8, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, -17, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, -13, 6, 6, -14,
|
||||
-45, -29, 7, -12, 0, -39, -3, 6,
|
||||
0, 0, 0, 0, 0, 0, -24, 0,
|
||||
-24, -8, 0, -15, -19, -2, -15, -14,
|
||||
-18, -14, -17, 0, 0, 0, -11, -32,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, -7, 0, 0, -14, -12,
|
||||
0, 0, 0, -12, 0, -10, 0, -12,
|
||||
-6, -11, -18, -7, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, -13, -37, 0, -20, 8, 0, -22,
|
||||
-12, 0, 0, 0, -27, -5, -29, -22,
|
||||
0, -36, 7, 0, 0, -4, 0, 0,
|
||||
0, 0, 0, 0, -14, 0, -14, 0,
|
||||
0, -4, 0, 0, 0, -5, 0, 0,
|
||||
0, 4, 0, -11, 0, -14, -5, 0,
|
||||
-18, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
3, 0, -10, 7, 0, 11, -5, 0,
|
||||
0, 0, 2, 0, -1, 0, 0, -1,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, -7, 0, -7, 0, 0, 0,
|
||||
0, 0, 3, 0, 4, -3, 0, 4,
|
||||
0, 0, 0, -4, 0, 0, -4, 0,
|
||||
-3, 0, -4, -4, 0, 0, -3, -3,
|
||||
-3, -7, -3, -7, 0, -3, 8, 0,
|
||||
2, -42, -19, 13, -2, 0, -44, 0,
|
||||
7, 0, 0, 0, 0, 0, 0, -13,
|
||||
0, -9, -3, 0, -6, 0, -4, 0,
|
||||
-7, -12, -7, -8, 0, 0, 0, 0,
|
||||
6, 0, 4, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 2, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, -10, -5,
|
||||
0, 0, 0, -10, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, -13, 0, 0, -35, 6, 0, -2,
|
||||
-19, -5, 0, -5, 0, -8, 0, 0,
|
||||
0, 0, 0, -9, 0, -11, -13, 0,
|
||||
-5, -5, -13, -13, -21, -11, -21, 0,
|
||||
-16, -33, 0, -29, 8, 0, -23, -15,
|
||||
0, 5, -3, -42, -14, -47, -35, 0,
|
||||
-57, 0, -2, 0, -6, -6, 0, -1,
|
||||
0, -9, -8, -30, 0, -30, 0, -3,
|
||||
3, 0, 4, -46, -26, 5, 0, 0,
|
||||
-51, 0, 0, 0, -1, -2, -8, 0,
|
||||
-10, -11, 0, -10, 0, 0, 0, 0,
|
||||
0, 0, 4, 0, 4, 0, 0, -4,
|
||||
0, -3, 12, 0, -1, -3, 0, 0,
|
||||
2, -4, -4, -9, -6, 0, -16, 0,
|
||||
0, 0, -4, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 3, 0, 0, 0, 7,
|
||||
0, 0, -5, 0, 0, -7, 2, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, -10, 10, 0, -26,
|
||||
-36, -27, 12, -10, 0, -45, 0, 7,
|
||||
0, 6, 6, 0, 0, 0, -38, 0,
|
||||
-36, -14, 0, -29, -36, -11, -28, -34,
|
||||
-34, -34, -28, -3, 6, 0, -8, -25,
|
||||
-22, 0, -6, 0, -23, -1, 6, 0,
|
||||
0, 0, 0, 0, 0, -25, 0, -20,
|
||||
-5, 0, -14, -15, 0, -11, -7, -11,
|
||||
-7, -11, 0, 0, 6, -29, 3, 0,
|
||||
4, -11, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, -8, 0, -11, 0,
|
||||
0, -5, -6, -10, -10, -20, 0, -20,
|
||||
0, -10, 4, 6, -23, -44, -36, 3,
|
||||
-18, 0, -44, -8, 0, 0, 0, 0,
|
||||
0, 0, 0, -36, 0, -34, -16, 0,
|
||||
-27, -30, -11, -25, -24, -22, -24, -25,
|
||||
0, 0, 3, -15, 6, 0, 3, -9,
|
||||
0, 0, -3, 0, 0, 0, 0, 0,
|
||||
0, 0, -2, 0, -5, 0, 0, 0,
|
||||
0, 0, 0, -11, 0, -11, 0, 0,
|
||||
-13, 0, -1, 0, 0, -10, 0, 0,
|
||||
0, 0, -28, 0, -24, -21, -3, -32,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, -4, 0, -4, 0, 0, -16,
|
||||
0, -3, -10, 0, -13, 0, 0, 0,
|
||||
0, -36, 0, -24, -20, -11, -34, 0,
|
||||
-3, 0, 0, -3, 0, 0, 0, -2,
|
||||
0, -7, -8, -7, -7, 0, 1, 0,
|
||||
6, 8, 0, -4, 0, 0, 0, 0,
|
||||
-25, 0, -17, -11, 6, -25, 0, 1,
|
||||
0, -1, 4, 0, 0, 0, 7, 0,
|
||||
0, 2, 0, 4, 0, 0, 4, 0,
|
||||
0, 0, 4, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, -2, 0, 5, -1,
|
||||
0, -8, 0, 0, 0, 0, -23, 0,
|
||||
-21, -16, -4, -29, 0, 0, 0, 0,
|
||||
0, 0, 0, 4, 0, 0, -1, -2,
|
||||
-1, 0, 0, 15, 0, -2, -25, 0,
|
||||
14, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, -9, 0, -8, 1,
|
||||
0, 0, 0, 4, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, -9,
|
||||
0, 0, 0, 0, -29, 0, -15, -14,
|
||||
0, -27, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 4, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 13, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, -7,
|
||||
0, 0, -9, 8, 0, -15, 0, 0,
|
||||
0, 0, -29, 0, -20, -18, 0, -27,
|
||||
0, -9, 0, -7, 0, 0, 0, -4,
|
||||
0, -3, 0, 0, 0, 0, 0, 8,
|
||||
0, 3, -35, -15, -9, 0, 0, -38,
|
||||
0, 0, 0, -14, 0, -16, -24, 0,
|
||||
-13, 0, -11, 0, 0, 0, -2, 9,
|
||||
0, 0, 0, 0, 0, 0, -9, 0,
|
||||
0, 0, 0, -10, 0, 0, 0, 0,
|
||||
-32, 0, -23, -16, -1, -34, 0, 0,
|
||||
0, 0, 0, 0, 0, 3, 0, 0,
|
||||
-3, 0, -3, 4, 0, -2, 3, -1,
|
||||
9, 0, -8, 0, 0, 0, 0, -22,
|
||||
0, -15, 0, -1, -22, 0, 0, 0,
|
||||
-3, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, -29,
|
||||
-14, -9, 0, 0, -26, 0, -34, 0,
|
||||
-14, -7, -20, -24, 0, -6, 0, -7,
|
||||
0, 0, 0, -3, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, -6, 3, 0,
|
||||
-13, 0, 0, 0, 0, -34, 0, -18,
|
||||
-11, 0, -22, 0, -5, 0, -8, 0,
|
||||
0, 0, 0, 4, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 3, 0, -10,
|
||||
0, 0, 0, 0, -31, 0, -18, -10,
|
||||
0, -24, 0, -5, 0, -7, 0, 0,
|
||||
0, 1, 0, 0, 0, 0, 0, 0
|
||||
};
|
||||
|
||||
|
||||
/*Collect the kern class' data in one place*/
|
||||
static const lv_font_fmt_txt_kern_classes_t kern_classes =
|
||||
{
|
||||
.class_pair_values = kern_class_values,
|
||||
.left_class_mapping = kern_left_class_mapping,
|
||||
.right_class_mapping = kern_right_class_mapping,
|
||||
.left_class_cnt = 40,
|
||||
.right_class_cnt = 31,
|
||||
};
|
||||
|
||||
/*--------------------
|
||||
* ALL CUSTOM DATA
|
||||
*--------------------*/
|
||||
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
/*Store all the custom data of the font*/
|
||||
static lv_font_fmt_txt_glyph_cache_t cache;
|
||||
static const lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
#else
|
||||
static lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
#endif
|
||||
.glyph_bitmap = Number_HarmonyOS_bpp4_20px_glyph_bitmap,
|
||||
.glyph_dsc = Number_HarmonyOS_bpp4_20px_glyph_dsc,
|
||||
.cmaps = cmaps,
|
||||
.kern_dsc = &kern_classes,
|
||||
.kern_scale = 16,
|
||||
.cmap_num = 2,
|
||||
.bpp = 4,
|
||||
.kern_classes = 1,
|
||||
.bitmap_format = 0,
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
.cache = &cache
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
/*-----------------
|
||||
* PUBLIC FONT
|
||||
*----------------*/
|
||||
|
||||
/*Initialize a public general font descriptor*/
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
const lv_font_t Number_HarmonyOS_bpp4_20px = {
|
||||
#else
|
||||
lv_font_t Number_HarmonyOS_bpp4_20px = {
|
||||
#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 = 23, /*The maximum line height required by the font*/
|
||||
.base_line = 5, /*Baseline measured from the bottom of the line*/
|
||||
#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 = -1,
|
||||
.underline_thickness = 1,
|
||||
#endif
|
||||
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif /*#if NUMBER_HARMONYOS_BPP4_20PX*/
|
||||
|
@ -0,0 +1,309 @@
|
||||
/*******************************************************************************
|
||||
* Size: 28 px
|
||||
* Bpp: 4
|
||||
* Opts: --no-compress --format lvgl --font HarmonyOS_Sans_SC_Medium.ttf -o Number_HarmonyOS_bpp4_28px.c --bpp 4 --size 28 -r 0x20-0x7f
|
||||
******************************************************************************/
|
||||
|
||||
#ifdef LV_LVGL_H_INCLUDE_SIMPLE
|
||||
#include "lvgl.h"
|
||||
#else
|
||||
#include "lvgl/lvgl.h"
|
||||
#endif
|
||||
|
||||
#ifndef NUMBER_HARMONYOS_BPP4_28PX
|
||||
#define NUMBER_HARMONYOS_BPP4_28PX 1
|
||||
#endif
|
||||
|
||||
#if NUMBER_HARMONYOS_BPP4_28PX
|
||||
|
||||
/*-----------------
|
||||
* BITMAPS
|
||||
*----------------*/
|
||||
|
||||
/*Store the image of the glyphs*/
|
||||
#include "bin_font.h"
|
||||
|
||||
/*---------------------
|
||||
* GLYPH DESCRIPTION
|
||||
*--------------------*/
|
||||
|
||||
|
||||
/*---------------------
|
||||
* CHARACTER MAPPING
|
||||
*--------------------*/
|
||||
|
||||
|
||||
|
||||
/*Collect the unicode lists and glyph_id offsets*/
|
||||
static const lv_font_fmt_txt_cmap_t cmaps[] =
|
||||
{
|
||||
{
|
||||
.range_start = 32, .range_length = 95, .glyph_id_start = 1,
|
||||
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
|
||||
}
|
||||
};
|
||||
|
||||
/*-----------------
|
||||
* KERNING
|
||||
*----------------*/
|
||||
|
||||
|
||||
/*Map glyph_ids to kern left classes*/
|
||||
static const uint8_t kern_left_class_mapping[] =
|
||||
{
|
||||
0, 0, 0, 1, 0, 0, 0, 0,
|
||||
1, 2, 3, 0, 4, 0, 4, 0,
|
||||
5, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 4,
|
||||
6, 7, 8, 9, 10, 7, 11, 12,
|
||||
13, 14, 14, 15, 16, 17, 14, 14,
|
||||
7, 18, 0, 19, 20, 21, 15, 5,
|
||||
22, 23, 24, 25, 2, 8, 3, 0,
|
||||
0, 0, 26, 27, 28, 29, 30, 31,
|
||||
32, 26, 0, 33, 34, 29, 26, 26,
|
||||
27, 27, 0, 35, 36, 37, 32, 38,
|
||||
38, 39, 38, 40, 2, 0, 3, 4
|
||||
};
|
||||
|
||||
/*Map glyph_ids to kern right classes*/
|
||||
static const uint8_t kern_right_class_mapping[] =
|
||||
{
|
||||
0, 1, 0, 2, 0, 0, 0, 0,
|
||||
2, 0, 3, 0, 4, 5, 4, 5,
|
||||
6, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 4, 0, 0,
|
||||
7, 8, 6, 9, 8, 9, 9, 9,
|
||||
8, 9, 9, 10, 9, 9, 9, 9,
|
||||
8, 9, 8, 9, 11, 12, 13, 14,
|
||||
15, 16, 17, 18, 0, 14, 3, 0,
|
||||
5, 0, 19, 20, 21, 21, 21, 22,
|
||||
21, 20, 0, 23, 20, 20, 24, 24,
|
||||
21, 0, 21, 24, 25, 26, 27, 28,
|
||||
28, 29, 30, 31, 0, 0, 3, 4
|
||||
};
|
||||
|
||||
/*Kern values between classes*/
|
||||
static const int8_t kern_class_values[] =
|
||||
{
|
||||
0, 0, 0, 0, 0, 0, 7, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 9, 0, 9, 9,
|
||||
4, 0, 6, 0, 0, 31, 0, 0,
|
||||
8, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 11, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, -24, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, -18, 8, 9, -20,
|
||||
-64, -41, 10, -17, 0, -54, -4, 9,
|
||||
0, 0, 0, 0, 0, 0, -34, 0,
|
||||
-33, -11, 0, -22, -26, -3, -22, -20,
|
||||
-25, -20, -24, 0, 0, 0, -15, -45,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, -10, 0, 0, -19, -16,
|
||||
0, 0, 0, -16, 0, -14, 0, -17,
|
||||
-9, -16, -25, -10, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, -18, -52, 0, -28, 12, 0, -30,
|
||||
-16, 0, 0, 0, -38, -7, -41, -31,
|
||||
0, -50, 9, 0, 0, -5, 0, 0,
|
||||
0, 0, 0, 0, -19, 0, -19, 0,
|
||||
0, -6, 0, 0, 0, -7, 0, 0,
|
||||
0, 6, 0, -16, 0, -20, -7, 0,
|
||||
-26, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
4, 0, -14, 10, 0, 15, -7, 0,
|
||||
0, 0, 2, 0, -1, 0, 0, -1,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, -10, 0, -10, 0, 0, 0,
|
||||
0, 0, 4, 0, 5, -4, 0, 5,
|
||||
0, 0, 0, -5, 0, 0, -6, 0,
|
||||
-4, 0, -5, -6, 0, 0, -4, -4,
|
||||
-4, -9, -4, -9, 0, -4, 12, 0,
|
||||
3, -59, -26, 18, -2, 0, -62, 0,
|
||||
10, 0, 0, 0, 0, 0, 0, -18,
|
||||
0, -13, -4, 0, -8, 0, -6, 0,
|
||||
-10, -16, -10, -11, 0, 0, 0, 0,
|
||||
8, 0, 5, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 3, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, -13, -7,
|
||||
0, 0, 0, -13, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, -18, 0, 0, -49, 8, 0, -3,
|
||||
-26, -7, 0, -7, 0, -12, 0, 0,
|
||||
0, 0, 0, -13, 0, -15, -18, 0,
|
||||
-7, -7, -18, -19, -30, -15, -30, 0,
|
||||
-22, -46, 0, -40, 12, 0, -32, -22,
|
||||
0, 8, -4, -59, -19, -66, -49, 0,
|
||||
-80, 0, -3, 0, -9, -9, 0, -1,
|
||||
0, -13, -12, -43, 0, -43, 0, -4,
|
||||
4, 0, 5, -65, -36, 7, 0, 0,
|
||||
-72, 0, 0, 0, -1, -2, -11, 0,
|
||||
-13, -15, 0, -13, 0, 0, 0, 0,
|
||||
0, 0, 5, 0, 5, 0, 0, -5,
|
||||
0, -4, 17, 0, -2, -4, 0, 0,
|
||||
3, -6, -6, -13, -8, 0, -22, 0,
|
||||
0, 0, -6, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 4, 0, 0, 0, 10,
|
||||
0, 0, -7, 0, 0, -10, 3, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, -13, 13, 0, -36,
|
||||
-51, -38, 16, -14, 0, -63, 0, 10,
|
||||
0, 9, 9, 0, 0, 0, -53, 0,
|
||||
-50, -20, 0, -41, -50, -15, -39, -47,
|
||||
-48, -47, -39, -4, 8, 0, -11, -34,
|
||||
-31, 0, -9, 0, -33, -1, 9, 0,
|
||||
0, 0, 0, 0, 0, -34, 0, -28,
|
||||
-7, 0, -19, -21, 0, -16, -10, -15,
|
||||
-10, -15, 0, 0, 9, -41, 4, 0,
|
||||
6, -16, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, -11, 0, -16, 0,
|
||||
0, -8, -8, -14, -14, -27, 0, -27,
|
||||
0, -13, 6, 9, -32, -62, -50, 4,
|
||||
-25, 0, -61, -11, 0, 0, 0, 0,
|
||||
0, 0, 0, -51, 0, -48, -23, 0,
|
||||
-38, -42, -15, -35, -33, -31, -33, -34,
|
||||
0, 0, 4, -21, 9, 0, 4, -13,
|
||||
0, 0, -4, 0, 0, 0, 0, 0,
|
||||
0, 0, -2, 0, -7, 0, 0, 0,
|
||||
0, 0, 0, -15, 0, -15, 0, 0,
|
||||
-18, 0, -1, 0, 0, -14, 0, 0,
|
||||
0, 0, -39, 0, -33, -30, -4, -45,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, -6, 0, -6, 0, 0, -22,
|
||||
0, -4, -14, 0, -18, 0, 0, 0,
|
||||
0, -50, 0, -33, -28, -16, -48, 0,
|
||||
-4, 0, 0, -4, 0, 0, 0, -2,
|
||||
0, -9, -11, -9, -10, 0, 2, 0,
|
||||
8, 11, 0, -5, 0, 0, 0, 0,
|
||||
-35, 0, -23, -15, 8, -34, 0, 1,
|
||||
0, -2, 6, 0, 0, 0, 10, 0,
|
||||
0, 3, 0, 6, 0, 0, 6, 0,
|
||||
0, 0, 5, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, -2, 0, 7, -1,
|
||||
0, -11, 0, 0, 0, 0, -32, 0,
|
||||
-29, -22, -6, -41, 0, 0, 0, 0,
|
||||
0, 0, 0, 5, 0, 0, -1, -3,
|
||||
-1, 0, 0, 21, 0, -3, -34, 0,
|
||||
20, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, -12, 0, -11, 1,
|
||||
0, 0, 0, 6, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, -12,
|
||||
0, 0, 0, 0, -41, 0, -22, -19,
|
||||
0, -38, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 5, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 19, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, -10,
|
||||
0, 0, -12, 11, 0, -22, 0, 0,
|
||||
0, 0, -41, 0, -27, -25, 0, -38,
|
||||
0, -13, 0, -10, 0, 0, 0, -5,
|
||||
0, -4, 0, 0, 0, 0, 0, 11,
|
||||
0, 4, -48, -21, -13, 0, 0, -53,
|
||||
0, 0, 0, -19, 0, -23, -34, 0,
|
||||
-19, 0, -15, 0, 0, 0, -3, 13,
|
||||
0, 0, 0, 0, 0, 0, -13, 0,
|
||||
0, 0, 0, -14, 0, 0, 0, 0,
|
||||
-45, 0, -32, -22, -2, -47, 0, 0,
|
||||
0, 0, 0, 0, 0, 4, 0, 0,
|
||||
-4, 0, -4, 5, 0, -3, 4, -1,
|
||||
13, 0, -11, 0, 0, 0, 0, -31,
|
||||
0, -21, 0, -1, -30, 0, 0, 0,
|
||||
-4, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, -41,
|
||||
-19, -12, 0, 0, -36, 0, -47, 0,
|
||||
-20, -10, -27, -33, 0, -9, 0, -9,
|
||||
0, 0, 0, -4, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, -9, 4, 0,
|
||||
-18, 0, 0, 0, 0, -48, 0, -25,
|
||||
-15, 0, -31, 0, -7, 0, -11, 0,
|
||||
0, 0, 0, 6, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 4, 0, -14,
|
||||
0, 0, 0, 0, -44, 0, -25, -14,
|
||||
0, -33, 0, -7, 0, -10, 0, 0,
|
||||
0, 1, 0, 0, 0, 0, 0, 0
|
||||
};
|
||||
|
||||
|
||||
/*Collect the kern class' data in one place*/
|
||||
static const lv_font_fmt_txt_kern_classes_t kern_classes =
|
||||
{
|
||||
.class_pair_values = kern_class_values,
|
||||
.left_class_mapping = kern_left_class_mapping,
|
||||
.right_class_mapping = kern_right_class_mapping,
|
||||
.left_class_cnt = 40,
|
||||
.right_class_cnt = 31,
|
||||
};
|
||||
|
||||
/*--------------------
|
||||
* ALL CUSTOM DATA
|
||||
*--------------------*/
|
||||
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
/*Store all the custom data of the font*/
|
||||
static lv_font_fmt_txt_glyph_cache_t cache;
|
||||
static const lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
#else
|
||||
static lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
#endif
|
||||
.glyph_bitmap = Number_HarmonyOS_bpp4_28px_glyph_bitmap,
|
||||
.glyph_dsc = Number_HarmonyOS_bpp4_28px_glyph_dsc,
|
||||
.cmaps = cmaps,
|
||||
.kern_dsc = &kern_classes,
|
||||
.kern_scale = 16,
|
||||
.cmap_num = 1,
|
||||
.bpp = 4,
|
||||
.kern_classes = 1,
|
||||
.bitmap_format = 0,
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
.cache = &cache
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
/*-----------------
|
||||
* PUBLIC FONT
|
||||
*----------------*/
|
||||
|
||||
/*Initialize a public general font descriptor*/
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
const lv_font_t Number_HarmonyOS_bpp4_28px = {
|
||||
#else
|
||||
lv_font_t Number_HarmonyOS_bpp4_28px = {
|
||||
#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 = 32, /*The maximum line height required by the font*/
|
||||
.base_line = 7, /*Baseline measured from the bottom of the line*/
|
||||
#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 = -2,
|
||||
.underline_thickness = 1,
|
||||
#endif
|
||||
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif /*#if NUMBER_HARMONYOS_BPP4_28PX*/
|
||||
|
@ -0,0 +1,295 @@
|
||||
/*******************************************************************************
|
||||
* Size: 36 px
|
||||
* Bpp: 4
|
||||
* Opts: --no-compress --format lvgl --font D:\code\lv_font_conv\lv_font_convert_tools\HarmonyOS_Sans_SC_Medium.ttf -o D:\code\lv_font_conv\lv_font_convert_tools\Number_HarmonyOS_bpp4_36px.c --bpp 4 --size 36 --symbols <20><><EFBFBD>H%:-GOQWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm/.+ -r 0x25-0x3A
|
||||
******************************************************************************/
|
||||
|
||||
#ifdef LV_LVGL_H_INCLUDE_SIMPLE
|
||||
#include "lvgl.h"
|
||||
#else
|
||||
#include "lvgl/lvgl.h"
|
||||
#endif
|
||||
|
||||
#ifndef NUMBER_HARMONYOS_BPP4_36PX
|
||||
#define NUMBER_HARMONYOS_BPP4_36PX 1
|
||||
#endif
|
||||
|
||||
#if NUMBER_HARMONYOS_BPP4_36PX
|
||||
|
||||
/*-----------------
|
||||
* BITMAPS
|
||||
*----------------*/
|
||||
|
||||
/*Store the image of the glyphs*/
|
||||
#include "bin_font.h"
|
||||
|
||||
/*---------------------
|
||||
* GLYPH DESCRIPTION
|
||||
*--------------------*/
|
||||
|
||||
|
||||
/*---------------------
|
||||
* CHARACTER MAPPING
|
||||
*--------------------*/
|
||||
|
||||
static const uint16_t unicode_list_3[] = {
|
||||
0x0, 0x6
|
||||
};
|
||||
|
||||
/*Collect the unicode lists and glyph_id offsets*/
|
||||
static const lv_font_fmt_txt_cmap_t cmaps[] =
|
||||
{
|
||||
{
|
||||
.range_start = 37, .range_length = 22, .glyph_id_start = 1,
|
||||
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
|
||||
},
|
||||
{
|
||||
.range_start = 65, .range_length = 26, .glyph_id_start = 23,
|
||||
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
|
||||
},
|
||||
{
|
||||
.range_start = 97, .range_length = 26, .glyph_id_start = 49,
|
||||
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
|
||||
},
|
||||
{
|
||||
.range_start = 8451, .range_length = 7, .glyph_id_start = 75,
|
||||
.unicode_list = unicode_list_3, .glyph_id_ofs_list = NULL, .list_length = 2, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY
|
||||
}
|
||||
};
|
||||
|
||||
/*-----------------
|
||||
* KERNING
|
||||
*----------------*/
|
||||
|
||||
|
||||
/*Map glyph_ids to kern left classes*/
|
||||
static const uint8_t kern_left_class_mapping[] =
|
||||
{
|
||||
0, 0, 0, 0, 1, 2, 0, 0,
|
||||
0, 0, 0, 3, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 4,
|
||||
5, 6, 7, 8, 9, 10, 0, 0,
|
||||
11, 12, 13, 0, 0, 7, 14, 0,
|
||||
15, 16, 17, 11, 3, 18, 19, 20,
|
||||
21, 22, 23, 24, 25, 26, 27, 28,
|
||||
22, 0, 29, 30, 25, 22, 22, 23,
|
||||
23, 0, 31, 32, 33, 28, 34, 34,
|
||||
35, 34, 36, 6, 9
|
||||
};
|
||||
|
||||
/*Map glyph_ids to kern right classes*/
|
||||
static const uint8_t kern_right_class_mapping[] =
|
||||
{
|
||||
0, 0, 0, 1, 0, 2, 0, 3,
|
||||
4, 3, 4, 5, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 5,
|
||||
6, 7, 6, 6, 6, 7, 6, 6,
|
||||
8, 6, 6, 6, 6, 7, 6, 7,
|
||||
6, 9, 10, 11, 12, 13, 14, 15,
|
||||
16, 17, 18, 19, 19, 19, 20, 19,
|
||||
18, 0, 21, 18, 18, 22, 22, 19,
|
||||
0, 19, 22, 23, 24, 25, 26, 26,
|
||||
27, 28, 29, 0, 0
|
||||
};
|
||||
|
||||
/*Kern values between classes*/
|
||||
static const int8_t kern_class_values[] =
|
||||
{
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 12, 0, 12, 12, 6,
|
||||
0, 8, 0, 0, 40, 0, 0, 10,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 14, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 10, 12, -25, -82, -53, 0,
|
||||
-21, -70, -6, 11, 0, 0, 0, 0,
|
||||
0, 0, -44, 0, -43, -14, 0, -28,
|
||||
-34, -4, -28, -26, -32, -26, -31, -67,
|
||||
0, -36, 15, 0, 0, -21, 0, 0,
|
||||
-48, -9, -53, -40, 0, -64, 12, 0,
|
||||
0, -6, 0, 0, 0, 0, 0, 0,
|
||||
-25, 0, -25, 0, -7, 0, 0, 0,
|
||||
-9, 0, 0, 8, 0, -20, 0, -26,
|
||||
-9, 0, -33, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 6, 0, -18, 13, 0, 0, -9,
|
||||
0, 0, 3, 0, -2, 0, 0, -2,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, -13, 0, -13, 0, -13, 0,
|
||||
0, -25, -21, 0, 0, -21, 0, -18,
|
||||
0, -21, -12, -20, -32, -13, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 6, 0,
|
||||
0, -6, 6, 0, 0, 0, -6, 0,
|
||||
0, -7, 0, -6, 0, -6, -8, 0,
|
||||
0, -5, -6, -5, -12, -5, -12, 0,
|
||||
15, 0, 3, -75, -33, 0, -3, -80,
|
||||
0, 13, 0, 0, 0, 0, 0, 0,
|
||||
-23, 0, -16, -5, 0, -10, 0, -7,
|
||||
0, -13, -21, -13, -14, 0, 0, 1,
|
||||
10, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, -17, -9, 0,
|
||||
0, -17, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, -63, 10, 0, -9, -33, 0, -9,
|
||||
0, -15, 0, 0, 0, 0, 0, -17,
|
||||
0, -20, -24, 0, -9, -9, -24, -24,
|
||||
-39, -20, -39, 0, -59, 0, -52, 15,
|
||||
0, 0, -28, 10, -5, -75, -25, -85,
|
||||
-63, 0, -103, 0, -4, 0, -12, -11,
|
||||
0, -1, 1, -16, -15, -55, 0, -55,
|
||||
0, 6, 0, 7, -83, -47, 0, 0,
|
||||
-92, 0, 0, 0, -2, -3, -14, 0,
|
||||
-17, -19, 0, -17, 0, 0, 0, 0,
|
||||
0, 0, 6, 0, 6, 0, -6, 0,
|
||||
-5, 22, 0, 0, -6, 0, 4, -7,
|
||||
-7, -16, -10, 0, -28, 0, 0, 0,
|
||||
-7, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 13, 0, 0, -9, 0,
|
||||
0, -13, 3, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
17, 0, -46, -66, -48, 0, -18, -81,
|
||||
0, 13, 0, 11, 12, 0, 0, 0,
|
||||
-69, 0, -64, -26, 0, -53, -64, -19,
|
||||
-51, -61, -62, -61, -50, 10, 0, -14,
|
||||
-44, -40, 0, -12, -42, -1, 12, 0,
|
||||
0, 0, 0, 0, 0, -44, 0, -36,
|
||||
-9, 0, -25, -26, 0, -20, -13, -19,
|
||||
-13, -20, 0, 12, -53, 6, 0, 0,
|
||||
-20, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, -14, 0, -20, 0, 0, -10,
|
||||
-10, -18, -18, -35, 0, -35, 0, 8,
|
||||
12, -41, -79, -64, 0, -32, -79, -14,
|
||||
0, 0, 0, 0, 0, 0, 0, -65,
|
||||
0, -62, -29, 0, -49, -54, -20, -45,
|
||||
-43, -40, -43, -44, 0, 6, -26, 12,
|
||||
0, 0, -16, 0, -6, 0, 0, 0,
|
||||
0, 0, 0, 0, -3, 0, -9, 0,
|
||||
0, 0, 0, 0, 0, -19, 0, -19,
|
||||
0, -24, 0, -1, 0, 0, 0, 0,
|
||||
0, 0, -50, 0, -43, -38, -5, -58,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
-1, 0, -7, 0, -7, 0, -29, 0,
|
||||
-6, -18, 0, 0, 0, 0, 0, -64,
|
||||
0, -43, -36, -20, -62, 0, -6, 0,
|
||||
0, -5, 0, 0, 0, -3, 0, -12,
|
||||
-14, -12, -13, 2, 0, 10, 14, 0,
|
||||
0, 0, 0, 0, -45, 0, -30, -20,
|
||||
10, -44, 0, 1, 0, -2, 7, 0,
|
||||
0, 0, 13, 0, 0, 4, 0, 8,
|
||||
0, 8, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, -3, 0, 9,
|
||||
-2, 0, 0, 0, 0, 0, -41, 0,
|
||||
-37, -28, -8, -53, 0, 0, 0, 0,
|
||||
0, 0, 0, 6, 0, 0, -1, -4,
|
||||
-1, 0, 27, 0, -4, -44, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, -16, 0, -14, 1, 0, 0,
|
||||
0, 8, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
-53, 0, -28, -25, 0, -49, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 7, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
24, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, -16, 14, 0, 0, 0,
|
||||
0, 0, -53, 0, -35, -32, 0, -49,
|
||||
0, -17, 0, -13, 0, 0, 0, -6,
|
||||
0, -5, 0, 0, 0, 0, 14, 0,
|
||||
5, -62, -27, 0, 0, -68, 0, 0,
|
||||
0, -25, 0, -29, -43, 0, -24, 0,
|
||||
-19, 0, 0, 0, -3, 17, 0, 0,
|
||||
0, 0, 0, -17, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, -58, 0, -41, -29,
|
||||
-2, -60, 0, 0, 0, 0, 0, 0,
|
||||
0, 5, 0, 0, -5, 0, -5, 7,
|
||||
-4, 6, -1, 16, 0, 0, 0, 0,
|
||||
0, -40, 0, -27, 0, -1, -39, 0,
|
||||
0, 0, -5, 0, 0, 0, 0, 0,
|
||||
0, -1, 0, 0, 0, 0, 0, 0,
|
||||
-52, -25, 0, 0, -46, 0, -61, 0,
|
||||
-26, -13, -35, -43, 0, -11, 0, -12,
|
||||
0, 0, 0, -6, 0, 0, 0, 0,
|
||||
0, -1, 0, 0, -12, 5, 0, 0,
|
||||
0, 0, 0, -62, 0, -32, -19, 0,
|
||||
-40, 0, -9, 0, -14, 0, 0, 0,
|
||||
0, 7, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 6, 0, 0, 0, 0, 0,
|
||||
-56, 0, -32, -18, 0, -43, 0, -9,
|
||||
0, -13, 0, 0, 0, 1, 0, 0,
|
||||
0, 0, 0, 0
|
||||
};
|
||||
|
||||
|
||||
/*Collect the kern class' data in one place*/
|
||||
static const lv_font_fmt_txt_kern_classes_t kern_classes =
|
||||
{
|
||||
.class_pair_values = kern_class_values,
|
||||
.left_class_mapping = kern_left_class_mapping,
|
||||
.right_class_mapping = kern_right_class_mapping,
|
||||
.left_class_cnt = 36,
|
||||
.right_class_cnt = 29,
|
||||
};
|
||||
|
||||
/*--------------------
|
||||
* ALL CUSTOM DATA
|
||||
*--------------------*/
|
||||
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
/*Store all the custom data of the font*/
|
||||
static lv_font_fmt_txt_glyph_cache_t cache;
|
||||
static const lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
#else
|
||||
static lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
#endif
|
||||
.glyph_bitmap = Number_HarmonyOS_bpp4_36px_glyph_bitmap,
|
||||
.glyph_dsc = Number_HarmonyOS_bpp4_36px_glyph_dsc,
|
||||
.cmaps = cmaps,
|
||||
.kern_dsc = &kern_classes,
|
||||
.kern_scale = 16,
|
||||
.cmap_num = 4,
|
||||
.bpp = 4,
|
||||
.kern_classes = 1,
|
||||
.bitmap_format = 0,
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
.cache = &cache
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
/*-----------------
|
||||
* PUBLIC FONT
|
||||
*----------------*/
|
||||
|
||||
/*Initialize a public general font descriptor*/
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
const lv_font_t Number_HarmonyOS_bpp4_36px = {
|
||||
#else
|
||||
lv_font_t Number_HarmonyOS_bpp4_36px = {
|
||||
#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 = 39, /*The maximum line height required by the font*/
|
||||
.base_line = 8, /*Baseline measured from the bottom of the line*/
|
||||
#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 = -3,
|
||||
.underline_thickness = 2,
|
||||
#endif
|
||||
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif /*#if NUMBER_HARMONYOS_BPP4_36PX*/
|
||||
|
@ -0,0 +1,132 @@
|
||||
/*******************************************************************************
|
||||
* Size: 44 px
|
||||
* Bpp: 4
|
||||
* Opts: --no-compress --format lvgl --font HarmonyOS_Sans_SC_Medium.ttf -o Number_HarmonyOS_bpp4_44px.c --bpp 4 --size 44 -r 0x30-0x39 -r 0x2d-0x2f -r 0x3a -r 0x25
|
||||
******************************************************************************/
|
||||
|
||||
#ifdef LV_LVGL_H_INCLUDE_SIMPLE
|
||||
#include "lvgl.h"
|
||||
#else
|
||||
#include "lvgl/lvgl.h"
|
||||
#endif
|
||||
|
||||
#ifndef NUMBER_HARMONYOS_BPP4_44PX
|
||||
#define NUMBER_HARMONYOS_BPP4_44PX 1
|
||||
#endif
|
||||
|
||||
#if NUMBER_HARMONYOS_BPP4_44PX
|
||||
|
||||
/*-----------------
|
||||
* BITMAPS
|
||||
*----------------*/
|
||||
|
||||
/*Store the image of the glyphs*/
|
||||
#include "bin_font.h"
|
||||
|
||||
/*---------------------
|
||||
* GLYPH DESCRIPTION
|
||||
*--------------------*/
|
||||
|
||||
|
||||
/*---------------------
|
||||
* CHARACTER MAPPING
|
||||
*--------------------*/
|
||||
|
||||
|
||||
|
||||
/*Collect the unicode lists and glyph_id offsets*/
|
||||
static const lv_font_fmt_txt_cmap_t cmaps[] =
|
||||
{
|
||||
{
|
||||
.range_start = 37, .range_length = 1, .glyph_id_start = 1,
|
||||
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
|
||||
},
|
||||
{
|
||||
.range_start = 45, .range_length = 14, .glyph_id_start = 2,
|
||||
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
|
||||
}
|
||||
};
|
||||
|
||||
/*-----------------
|
||||
* KERNING
|
||||
*----------------*/
|
||||
|
||||
|
||||
/*Pair left and right glyphs for kerning*/
|
||||
static const uint8_t kern_pair_glyph_ids[] =
|
||||
{
|
||||
4, 2,
|
||||
4, 3,
|
||||
4, 4
|
||||
};
|
||||
|
||||
/* Kerning between the respective left and right glyphs
|
||||
* 4.4 format which needs to scaled with `kern_scale`*/
|
||||
static const int8_t kern_pair_values[] =
|
||||
{
|
||||
-31, -100, -65
|
||||
};
|
||||
|
||||
/*Collect the kern pair's data in one place*/
|
||||
static const lv_font_fmt_txt_kern_pair_t kern_pairs =
|
||||
{
|
||||
.glyph_ids = kern_pair_glyph_ids,
|
||||
.values = kern_pair_values,
|
||||
.pair_cnt = 3,
|
||||
.glyph_ids_size = 0
|
||||
};
|
||||
|
||||
/*--------------------
|
||||
* ALL CUSTOM DATA
|
||||
*--------------------*/
|
||||
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
/*Store all the custom data of the font*/
|
||||
static lv_font_fmt_txt_glyph_cache_t cache;
|
||||
static const lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
#else
|
||||
static lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
#endif
|
||||
.glyph_bitmap = Number_HarmonyOS_bpp4_44px_glyph_bitmap,
|
||||
.glyph_dsc = Number_HarmonyOS_bpp4_44px_glyph_dsc,
|
||||
.cmaps = cmaps,
|
||||
.kern_dsc = &kern_pairs,
|
||||
.kern_scale = 16,
|
||||
.cmap_num = 2,
|
||||
.bpp = 4,
|
||||
.kern_classes = 0,
|
||||
.bitmap_format = 0,
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
.cache = &cache
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
/*-----------------
|
||||
* PUBLIC FONT
|
||||
*----------------*/
|
||||
|
||||
/*Initialize a public general font descriptor*/
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
const lv_font_t Number_HarmonyOS_bpp4_44px = {
|
||||
#else
|
||||
lv_font_t Number_HarmonyOS_bpp4_44px = {
|
||||
#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 = 33, /*The maximum line height required by the font*/
|
||||
.base_line = 0, /*Baseline measured from the bottom of the line*/
|
||||
#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 = -3,
|
||||
.underline_thickness = 2,
|
||||
#endif
|
||||
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif /*#if NUMBER_HARMONYOS_BPP4_44PX*/
|
||||
|
@ -0,0 +1,132 @@
|
||||
/*******************************************************************************
|
||||
* Size: 46 px
|
||||
* Bpp: 4
|
||||
* Opts: --no-compress --format lvgl --font HarmonyOS_Sans_SC_Medium.ttf -o Number_HarmonyOS_bpp4_46px.c --bpp 4 --size 46 -r 0x30-0x39 -r 0x2d-0x2f -r 0x25 -r 0x3a
|
||||
******************************************************************************/
|
||||
|
||||
#ifdef LV_LVGL_H_INCLUDE_SIMPLE
|
||||
#include "lvgl.h"
|
||||
#else
|
||||
#include "lvgl/lvgl.h"
|
||||
#endif
|
||||
|
||||
#ifndef NUMBER_HARMONYOS_BPP4_46PX
|
||||
#define NUMBER_HARMONYOS_BPP4_46PX 1
|
||||
#endif
|
||||
|
||||
#if NUMBER_HARMONYOS_BPP4_46PX
|
||||
|
||||
/*-----------------
|
||||
* BITMAPS
|
||||
*----------------*/
|
||||
|
||||
/*Store the image of the glyphs*/
|
||||
#include "bin_font.h"
|
||||
|
||||
/*---------------------
|
||||
* GLYPH DESCRIPTION
|
||||
*--------------------*/
|
||||
|
||||
|
||||
/*---------------------
|
||||
* CHARACTER MAPPING
|
||||
*--------------------*/
|
||||
|
||||
|
||||
|
||||
/*Collect the unicode lists and glyph_id offsets*/
|
||||
static const lv_font_fmt_txt_cmap_t cmaps[] =
|
||||
{
|
||||
{
|
||||
.range_start = 37, .range_length = 1, .glyph_id_start = 1,
|
||||
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
|
||||
},
|
||||
{
|
||||
.range_start = 45, .range_length = 14, .glyph_id_start = 2,
|
||||
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
|
||||
}
|
||||
};
|
||||
|
||||
/*-----------------
|
||||
* KERNING
|
||||
*----------------*/
|
||||
|
||||
|
||||
/*Pair left and right glyphs for kerning*/
|
||||
static const uint8_t kern_pair_glyph_ids[] =
|
||||
{
|
||||
4, 2,
|
||||
4, 3,
|
||||
4, 4
|
||||
};
|
||||
|
||||
/* Kerning between the respective left and right glyphs
|
||||
* 4.4 format which needs to scaled with `kern_scale`*/
|
||||
static const int8_t kern_pair_values[] =
|
||||
{
|
||||
-32, -105, -68
|
||||
};
|
||||
|
||||
/*Collect the kern pair's data in one place*/
|
||||
static const lv_font_fmt_txt_kern_pair_t kern_pairs =
|
||||
{
|
||||
.glyph_ids = kern_pair_glyph_ids,
|
||||
.values = kern_pair_values,
|
||||
.pair_cnt = 3,
|
||||
.glyph_ids_size = 0
|
||||
};
|
||||
|
||||
/*--------------------
|
||||
* ALL CUSTOM DATA
|
||||
*--------------------*/
|
||||
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
/*Store all the custom data of the font*/
|
||||
static lv_font_fmt_txt_glyph_cache_t cache;
|
||||
static const lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
#else
|
||||
static lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
#endif
|
||||
.glyph_bitmap = Number_HarmonyOS_bpp4_46px_glyph_bitmap,
|
||||
.glyph_dsc = Number_HarmonyOS_bpp4_46px_glyph_dsc,
|
||||
.cmaps = cmaps,
|
||||
.kern_dsc = &kern_pairs,
|
||||
.kern_scale = 16,
|
||||
.cmap_num = 2,
|
||||
.bpp = 4,
|
||||
.kern_classes = 0,
|
||||
.bitmap_format = 0,
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
.cache = &cache
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
/*-----------------
|
||||
* PUBLIC FONT
|
||||
*----------------*/
|
||||
|
||||
/*Initialize a public general font descriptor*/
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
const lv_font_t Number_HarmonyOS_bpp4_46px = {
|
||||
#else
|
||||
lv_font_t Number_HarmonyOS_bpp4_46px = {
|
||||
#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 = 36, /*The maximum line height required by the font*/
|
||||
.base_line = 1, /*Baseline measured from the bottom of the line*/
|
||||
#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 = -3,
|
||||
.underline_thickness = 2,
|
||||
#endif
|
||||
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif /*#if NUMBER_HARMONYOS_BPP4_46PX*/
|
||||
|
@ -0,0 +1,132 @@
|
||||
/*******************************************************************************
|
||||
* Size: 50 px
|
||||
* Bpp: 4
|
||||
* Opts: --no-compress --format lvgl --font HarmonyOS_Sans_SC_Medium.ttf -o Number_HarmonyOS_bpp4_50px.c --bpp 4 --size 50 -r 0x30-0x39 -r 0x2d-0x2f -r 0x25 -r 0x3a
|
||||
******************************************************************************/
|
||||
|
||||
#ifdef LV_LVGL_H_INCLUDE_SIMPLE
|
||||
#include "lvgl.h"
|
||||
#else
|
||||
#include "lvgl/lvgl.h"
|
||||
#endif
|
||||
|
||||
#ifndef NUMBER_HARMONYOS_BPP4_50PX
|
||||
#define NUMBER_HARMONYOS_BPP4_50PX 1
|
||||
#endif
|
||||
|
||||
#if NUMBER_HARMONYOS_BPP4_50PX
|
||||
|
||||
/*-----------------
|
||||
* BITMAPS
|
||||
*----------------*/
|
||||
|
||||
/*Store the image of the glyphs*/
|
||||
#include "bin_font.h"
|
||||
|
||||
/*---------------------
|
||||
* GLYPH DESCRIPTION
|
||||
*--------------------*/
|
||||
|
||||
|
||||
/*---------------------
|
||||
* CHARACTER MAPPING
|
||||
*--------------------*/
|
||||
|
||||
|
||||
|
||||
/*Collect the unicode lists and glyph_id offsets*/
|
||||
static const lv_font_fmt_txt_cmap_t cmaps[] =
|
||||
{
|
||||
{
|
||||
.range_start = 37, .range_length = 1, .glyph_id_start = 1,
|
||||
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
|
||||
},
|
||||
{
|
||||
.range_start = 45, .range_length = 14, .glyph_id_start = 2,
|
||||
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
|
||||
}
|
||||
};
|
||||
|
||||
/*-----------------
|
||||
* KERNING
|
||||
*----------------*/
|
||||
|
||||
|
||||
/*Pair left and right glyphs for kerning*/
|
||||
static const uint8_t kern_pair_glyph_ids[] =
|
||||
{
|
||||
4, 2,
|
||||
4, 3,
|
||||
4, 4
|
||||
};
|
||||
|
||||
/* Kerning between the respective left and right glyphs
|
||||
* 4.4 format which needs to scaled with `kern_scale`*/
|
||||
static const int8_t kern_pair_values[] =
|
||||
{
|
||||
-35, -114, -74
|
||||
};
|
||||
|
||||
/*Collect the kern pair's data in one place*/
|
||||
static const lv_font_fmt_txt_kern_pair_t kern_pairs =
|
||||
{
|
||||
.glyph_ids = kern_pair_glyph_ids,
|
||||
.values = kern_pair_values,
|
||||
.pair_cnt = 3,
|
||||
.glyph_ids_size = 0
|
||||
};
|
||||
|
||||
/*--------------------
|
||||
* ALL CUSTOM DATA
|
||||
*--------------------*/
|
||||
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
/*Store all the custom data of the font*/
|
||||
static lv_font_fmt_txt_glyph_cache_t cache;
|
||||
static const lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
#else
|
||||
static lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
#endif
|
||||
.glyph_bitmap = Number_HarmonyOS_bpp4_50px_glyph_bitmap,
|
||||
.glyph_dsc = Number_HarmonyOS_bpp4_50px_glyph_dsc,
|
||||
.cmaps = cmaps,
|
||||
.kern_dsc = &kern_pairs,
|
||||
.kern_scale = 16,
|
||||
.cmap_num = 2,
|
||||
.bpp = 4,
|
||||
.kern_classes = 0,
|
||||
.bitmap_format = 0,
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
.cache = &cache
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
/*-----------------
|
||||
* PUBLIC FONT
|
||||
*----------------*/
|
||||
|
||||
/*Initialize a public general font descriptor*/
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
const lv_font_t Number_HarmonyOS_bpp4_50px = {
|
||||
#else
|
||||
lv_font_t Number_HarmonyOS_bpp4_50px = {
|
||||
#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 = 39, /*The maximum line height required by the font*/
|
||||
.base_line = 1, /*Baseline measured from the bottom of the line*/
|
||||
#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 = -4,
|
||||
.underline_thickness = 3,
|
||||
#endif
|
||||
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif /*#if NUMBER_HARMONYOS_BPP4_50PX*/
|
||||
|
@ -0,0 +1,132 @@
|
||||
/*******************************************************************************
|
||||
* Size: 62 px
|
||||
* Bpp: 4
|
||||
* Opts: --no-compress --format lvgl --font HarmonyOS_Sans_SC_Medium.ttf -o Number_HarmonyOS_bpp4_62px.c --bpp 4 --size 62 -r 0x30-0x39 -r 0x2d-0x2f -r 0x3a -r 0x25
|
||||
******************************************************************************/
|
||||
|
||||
#ifdef LV_LVGL_H_INCLUDE_SIMPLE
|
||||
#include "lvgl.h"
|
||||
#else
|
||||
#include "lvgl/lvgl.h"
|
||||
#endif
|
||||
|
||||
#ifndef NUMBER_HARMONYOS_BPP4_62PX
|
||||
#define NUMBER_HARMONYOS_BPP4_62PX 1
|
||||
#endif
|
||||
|
||||
#if NUMBER_HARMONYOS_BPP4_62PX
|
||||
|
||||
/*-----------------
|
||||
* BITMAPS
|
||||
*----------------*/
|
||||
|
||||
/*Store the image of the glyphs*/
|
||||
#include "bin_font.h"
|
||||
|
||||
/*---------------------
|
||||
* GLYPH DESCRIPTION
|
||||
*--------------------*/
|
||||
|
||||
|
||||
/*---------------------
|
||||
* CHARACTER MAPPING
|
||||
*--------------------*/
|
||||
|
||||
|
||||
|
||||
/*Collect the unicode lists and glyph_id offsets*/
|
||||
static const lv_font_fmt_txt_cmap_t cmaps[] =
|
||||
{
|
||||
{
|
||||
.range_start = 37, .range_length = 1, .glyph_id_start = 1,
|
||||
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
|
||||
},
|
||||
{
|
||||
.range_start = 45, .range_length = 14, .glyph_id_start = 2,
|
||||
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
|
||||
}
|
||||
};
|
||||
|
||||
/*-----------------
|
||||
* KERNING
|
||||
*----------------*/
|
||||
|
||||
|
||||
/*Pair left and right glyphs for kerning*/
|
||||
static const uint8_t kern_pair_glyph_ids[] =
|
||||
{
|
||||
4, 2,
|
||||
4, 3,
|
||||
4, 4
|
||||
};
|
||||
|
||||
/* Kerning between the respective left and right glyphs
|
||||
* 4.4 format which needs to scaled with `kern_scale`*/
|
||||
static const int8_t kern_pair_values[] =
|
||||
{
|
||||
-37, -119, -77
|
||||
};
|
||||
|
||||
/*Collect the kern pair's data in one place*/
|
||||
static const lv_font_fmt_txt_kern_pair_t kern_pairs =
|
||||
{
|
||||
.glyph_ids = kern_pair_glyph_ids,
|
||||
.values = kern_pair_values,
|
||||
.pair_cnt = 3,
|
||||
.glyph_ids_size = 0
|
||||
};
|
||||
|
||||
/*--------------------
|
||||
* ALL CUSTOM DATA
|
||||
*--------------------*/
|
||||
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
/*Store all the custom data of the font*/
|
||||
static lv_font_fmt_txt_glyph_cache_t cache;
|
||||
static const lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
#else
|
||||
static lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
#endif
|
||||
.glyph_bitmap = Number_HarmonyOS_bpp4_62px_glyph_bitmap,
|
||||
.glyph_dsc = Number_HarmonyOS_bpp4_62px_glyph_dsc,
|
||||
.cmaps = cmaps,
|
||||
.kern_dsc = &kern_pairs,
|
||||
.kern_scale = 19,
|
||||
.cmap_num = 2,
|
||||
.bpp = 4,
|
||||
.kern_classes = 0,
|
||||
.bitmap_format = 0,
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
.cache = &cache
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
/*-----------------
|
||||
* PUBLIC FONT
|
||||
*----------------*/
|
||||
|
||||
/*Initialize a public general font descriptor*/
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
const lv_font_t Number_HarmonyOS_bpp4_62px = {
|
||||
#else
|
||||
lv_font_t Number_HarmonyOS_bpp4_62px = {
|
||||
#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 = 47, /*The maximum line height required by the font*/
|
||||
.base_line = 1, /*Baseline measured from the bottom of the line*/
|
||||
#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 = -5,
|
||||
.underline_thickness = 3,
|
||||
#endif
|
||||
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif /*#if NUMBER_HARMONYOS_BPP4_62PX*/
|
||||
|
@ -0,0 +1,132 @@
|
||||
/*******************************************************************************
|
||||
* Size: 80 px
|
||||
* Bpp: 4
|
||||
* Opts: --no-compress --format lvgl --font HarmonyOS_Sans_SC_Medium.ttf -o Number_HarmonyOS_bpp4_80px.c --bpp 4 --size 80 -r 0x30-0x39 -r 0x2d-0x2f -r 0x25 -r 0x3a
|
||||
******************************************************************************/
|
||||
|
||||
#ifdef LV_LVGL_H_INCLUDE_SIMPLE
|
||||
#include "lvgl.h"
|
||||
#else
|
||||
#include "lvgl/lvgl.h"
|
||||
#endif
|
||||
|
||||
#ifndef NUMBER_HARMONYOS_BPP4_80PX
|
||||
#define NUMBER_HARMONYOS_BPP4_80PX 1
|
||||
#endif
|
||||
|
||||
#if NUMBER_HARMONYOS_BPP4_80PX
|
||||
|
||||
/*-----------------
|
||||
* BITMAPS
|
||||
*----------------*/
|
||||
|
||||
/*Store the image of the glyphs*/
|
||||
#include "bin_font.h"
|
||||
|
||||
/*---------------------
|
||||
* GLYPH DESCRIPTION
|
||||
*--------------------*/
|
||||
|
||||
|
||||
/*---------------------
|
||||
* CHARACTER MAPPING
|
||||
*--------------------*/
|
||||
|
||||
|
||||
|
||||
/*Collect the unicode lists and glyph_id offsets*/
|
||||
static const lv_font_fmt_txt_cmap_t cmaps[] =
|
||||
{
|
||||
{
|
||||
.range_start = 37, .range_length = 1, .glyph_id_start = 1,
|
||||
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
|
||||
},
|
||||
{
|
||||
.range_start = 45, .range_length = 14, .glyph_id_start = 2,
|
||||
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
|
||||
}
|
||||
};
|
||||
|
||||
/*-----------------
|
||||
* KERNING
|
||||
*----------------*/
|
||||
|
||||
|
||||
/*Pair left and right glyphs for kerning*/
|
||||
static const uint8_t kern_pair_glyph_ids[] =
|
||||
{
|
||||
4, 2,
|
||||
4, 3,
|
||||
4, 4
|
||||
};
|
||||
|
||||
/* Kerning between the respective left and right glyphs
|
||||
* 4.4 format which needs to scaled with `kern_scale`*/
|
||||
static const int8_t kern_pair_values[] =
|
||||
{
|
||||
-36, -116, -75
|
||||
};
|
||||
|
||||
/*Collect the kern pair's data in one place*/
|
||||
static const lv_font_fmt_txt_kern_pair_t kern_pairs =
|
||||
{
|
||||
.glyph_ids = kern_pair_glyph_ids,
|
||||
.values = kern_pair_values,
|
||||
.pair_cnt = 3,
|
||||
.glyph_ids_size = 0
|
||||
};
|
||||
|
||||
/*--------------------
|
||||
* ALL CUSTOM DATA
|
||||
*--------------------*/
|
||||
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
/*Store all the custom data of the font*/
|
||||
static lv_font_fmt_txt_glyph_cache_t cache;
|
||||
static const lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
#else
|
||||
static lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
#endif
|
||||
.glyph_bitmap = Number_HarmonyOS_bpp4_80px_glyph_bitmap,
|
||||
.glyph_dsc = Number_HarmonyOS_bpp4_80px_glyph_dsc,
|
||||
.cmaps = cmaps,
|
||||
.kern_dsc = &kern_pairs,
|
||||
.kern_scale = 25,
|
||||
.cmap_num = 2,
|
||||
.bpp = 4,
|
||||
.kern_classes = 0,
|
||||
.bitmap_format = 0,
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
.cache = &cache
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
/*-----------------
|
||||
* PUBLIC FONT
|
||||
*----------------*/
|
||||
|
||||
/*Initialize a public general font descriptor*/
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
const lv_font_t Number_HarmonyOS_bpp4_80px = {
|
||||
#else
|
||||
lv_font_t Number_HarmonyOS_bpp4_80px = {
|
||||
#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 = 62, /*The maximum line height required by the font*/
|
||||
.base_line = 1, /*Baseline measured from the bottom of the line*/
|
||||
#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 = -6,
|
||||
.underline_thickness = 4,
|
||||
#endif
|
||||
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif /*#if NUMBER_HARMONYOS_BPP4_80PX*/
|
||||
|
@ -0,0 +1,132 @@
|
||||
/*******************************************************************************
|
||||
* Size: 92 px
|
||||
* Bpp: 4
|
||||
* Opts: --no-compress --format lvgl --font HarmonyOS_Sans_SC_Medium.ttf -o Number_HarmonyOS_bpp4_92px.c --bpp 4 --size 92 -r 0x30-0x39 -r 0x2d-0x2f -r 0x3a -r 0x25
|
||||
******************************************************************************/
|
||||
|
||||
#ifdef LV_LVGL_H_INCLUDE_SIMPLE
|
||||
#include "lvgl.h"
|
||||
#else
|
||||
#include "lvgl/lvgl.h"
|
||||
#endif
|
||||
|
||||
#ifndef NUMBER_HARMONYOS_BPP4_92PX
|
||||
#define NUMBER_HARMONYOS_BPP4_92PX 1
|
||||
#endif
|
||||
|
||||
#if NUMBER_HARMONYOS_BPP4_92PX
|
||||
|
||||
/*-----------------
|
||||
* BITMAPS
|
||||
*----------------*/
|
||||
|
||||
/*Store the image of the glyphs*/
|
||||
#include "bin_font.h"
|
||||
|
||||
/*---------------------
|
||||
* GLYPH DESCRIPTION
|
||||
*--------------------*/
|
||||
|
||||
|
||||
/*---------------------
|
||||
* CHARACTER MAPPING
|
||||
*--------------------*/
|
||||
|
||||
|
||||
|
||||
/*Collect the unicode lists and glyph_id offsets*/
|
||||
static const lv_font_fmt_txt_cmap_t cmaps[] =
|
||||
{
|
||||
{
|
||||
.range_start = 37, .range_length = 1, .glyph_id_start = 1,
|
||||
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
|
||||
},
|
||||
{
|
||||
.range_start = 45, .range_length = 14, .glyph_id_start = 2,
|
||||
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
|
||||
}
|
||||
};
|
||||
|
||||
/*-----------------
|
||||
* KERNING
|
||||
*----------------*/
|
||||
|
||||
|
||||
/*Pair left and right glyphs for kerning*/
|
||||
static const uint8_t kern_pair_glyph_ids[] =
|
||||
{
|
||||
4, 2,
|
||||
4, 3,
|
||||
4, 4
|
||||
};
|
||||
|
||||
/* Kerning between the respective left and right glyphs
|
||||
* 4.4 format which needs to scaled with `kern_scale`*/
|
||||
static const int8_t kern_pair_values[] =
|
||||
{
|
||||
-37, -119, -77
|
||||
};
|
||||
|
||||
/*Collect the kern pair's data in one place*/
|
||||
static const lv_font_fmt_txt_kern_pair_t kern_pairs =
|
||||
{
|
||||
.glyph_ids = kern_pair_glyph_ids,
|
||||
.values = kern_pair_values,
|
||||
.pair_cnt = 3,
|
||||
.glyph_ids_size = 0
|
||||
};
|
||||
|
||||
/*--------------------
|
||||
* ALL CUSTOM DATA
|
||||
*--------------------*/
|
||||
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
/*Store all the custom data of the font*/
|
||||
static lv_font_fmt_txt_glyph_cache_t cache;
|
||||
static const lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
#else
|
||||
static lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
#endif
|
||||
.glyph_bitmap = Number_HarmonyOS_bpp4_92px_glyph_bitmap,
|
||||
.glyph_dsc = Number_HarmonyOS_bpp4_92px_glyph_dsc,
|
||||
.cmaps = cmaps,
|
||||
.kern_dsc = &kern_pairs,
|
||||
.kern_scale = 28,
|
||||
.cmap_num = 2,
|
||||
.bpp = 4,
|
||||
.kern_classes = 0,
|
||||
.bitmap_format = 0,
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
.cache = &cache
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
/*-----------------
|
||||
* PUBLIC FONT
|
||||
*----------------*/
|
||||
|
||||
/*Initialize a public general font descriptor*/
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
const lv_font_t Number_HarmonyOS_bpp4_92px = {
|
||||
#else
|
||||
lv_font_t Number_HarmonyOS_bpp4_92px = {
|
||||
#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 = 70, /*The maximum line height required by the font*/
|
||||
.base_line = 1, /*Baseline measured from the bottom of the line*/
|
||||
#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 = -7,
|
||||
.underline_thickness = 5,
|
||||
#endif
|
||||
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif /*#if NUMBER_HARMONYOS_BPP4_92PX*/
|
||||
|
Reference in New Issue
Block a user