1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-21 06:53:01 +08:00

font: fix generated font file

This commit is contained in:
Gabor Kiss-Vamosi 2019-05-31 05:34:44 +02:00
parent 56d7b986d4
commit 23e7e4e8e2
3 changed files with 35 additions and 512 deletions

View File

@ -374,15 +374,14 @@ static const uint8_t gylph_bitmap[] = {
/* U+7E "~" */
0x7, 0x66, 0xdc, 0x20, 0x0
}
};
/*---------------------
* GLYPH DESCRIPTION
*--------------------*/
static lv_font_glyph_dsc_fmt_txt_t glyph_dsc[] = {
{.bitmap_index = 0, .adv_w = 0, .box_h = 0, .box_w = 0, .ofs_x = 0, .ofs_y = 0} // id = 0 reserved,
static lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = {
{.bitmap_index = 0, .adv_w = 0, .box_h = 0, .box_w = 0, .ofs_x = 0, .ofs_y = 0}, /* id = 0 reserved */
{.bitmap_index = 0, .adv_w = 64, .box_h = 0, .box_w = 0, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 0, .adv_w = 67, .box_h = 12, .box_w = 2, .ofs_x = 1, .ofs_y = 0},
{.bitmap_index = 3, .adv_w = 92, .box_h = 5, .box_w = 5, .ofs_x = 0, .ofs_y = 7},
@ -478,16 +477,12 @@ static lv_font_glyph_dsc_fmt_txt_t glyph_dsc[] = {
{.bitmap_index = 1036, .adv_w = 63, .box_h = 15, .box_w = 2, .ofs_x = 1, .ofs_y = -3},
{.bitmap_index = 1040, .adv_w = 87, .box_h = 16, .box_w = 5, .ofs_x = 0, .ofs_y = -3},
{.bitmap_index = 1050, .adv_w = 174, .box_h = 4, .box_w = 9, .ofs_x = 1, .ofs_y = 3}
}
};
/*---------------------
* CHARACTER MAPPING
*--------------------*/
/*Collect the unicode lists and glyph_id offsets*/
static const lv_font_fmt_txt_cmap_t cmaps[] =
{
@ -495,506 +490,23 @@ static const lv_font_fmt_txt_cmap_t cmaps[] =
.range_start = 32, .range_length = 95, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY,
.glyph_id_start = 1, .unicode_list = NULL, .glyph_id_ofs_list = NULL
}
}
};
/*-----------------
* KERNING
*----------------*/
/*Pair left and right glyphs for kerning*/
static lv_font_fmt_txt_kern_pair_id_t kern_pair_glyph_ids[] =
static const uint8_t kern_pair_glyph_ids[] =
{
{.pair.left = 9, .pair.right = 43},
{.pair.left = 9, .pair.right = 55},
{.pair.left = 9, .pair.right = 56},
{.pair.left = 9, .pair.right = 58},
{.pair.left = 17, .pair.right = 17},
{.pair.left = 17, .pair.right = 18},
{.pair.left = 17, .pair.right = 20},
{.pair.left = 17, .pair.right = 21},
{.pair.left = 17, .pair.right = 22},
{.pair.left = 17, .pair.right = 23},
{.pair.left = 17, .pair.right = 24},
{.pair.left = 17, .pair.right = 26},
{.pair.left = 18, .pair.right = 19},
{.pair.left = 18, .pair.right = 20},
{.pair.left = 18, .pair.right = 22},
{.pair.left = 18, .pair.right = 24},
{.pair.left = 19, .pair.right = 17},
{.pair.left = 19, .pair.right = 18},
{.pair.left = 19, .pair.right = 19},
{.pair.left = 19, .pair.right = 22},
{.pair.left = 19, .pair.right = 23},
{.pair.left = 19, .pair.right = 24},
{.pair.left = 19, .pair.right = 25},
{.pair.left = 19, .pair.right = 26},
{.pair.left = 20, .pair.right = 18},
{.pair.left = 20, .pair.right = 19},
{.pair.left = 20, .pair.right = 20},
{.pair.left = 20, .pair.right = 21},
{.pair.left = 20, .pair.right = 22},
{.pair.left = 20, .pair.right = 23},
{.pair.left = 20, .pair.right = 24},
{.pair.left = 20, .pair.right = 25},
{.pair.left = 20, .pair.right = 26},
{.pair.left = 21, .pair.right = 17},
{.pair.left = 21, .pair.right = 19},
{.pair.left = 21, .pair.right = 21},
{.pair.left = 21, .pair.right = 22},
{.pair.left = 21, .pair.right = 23},
{.pair.left = 21, .pair.right = 24},
{.pair.left = 21, .pair.right = 25},
{.pair.left = 22, .pair.right = 18},
{.pair.left = 22, .pair.right = 19},
{.pair.left = 22, .pair.right = 20},
{.pair.left = 22, .pair.right = 21},
{.pair.left = 22, .pair.right = 22},
{.pair.left = 22, .pair.right = 23},
{.pair.left = 22, .pair.right = 24},
{.pair.left = 22, .pair.right = 25},
{.pair.left = 22, .pair.right = 26},
{.pair.left = 23, .pair.right = 17},
{.pair.left = 23, .pair.right = 18},
{.pair.left = 23, .pair.right = 19},
{.pair.left = 23, .pair.right = 21},
{.pair.left = 23, .pair.right = 22},
{.pair.left = 23, .pair.right = 23},
{.pair.left = 23, .pair.right = 24},
{.pair.left = 23, .pair.right = 25},
{.pair.left = 24, .pair.right = 18},
{.pair.left = 24, .pair.right = 21},
{.pair.left = 24, .pair.right = 22},
{.pair.left = 24, .pair.right = 23},
{.pair.left = 24, .pair.right = 24},
{.pair.left = 24, .pair.right = 25},
{.pair.left = 24, .pair.right = 26},
{.pair.left = 25, .pair.right = 17},
{.pair.left = 25, .pair.right = 18},
{.pair.left = 25, .pair.right = 20},
{.pair.left = 25, .pair.right = 21},
{.pair.left = 25, .pair.right = 22},
{.pair.left = 25, .pair.right = 23},
{.pair.left = 26, .pair.right = 17},
{.pair.left = 26, .pair.right = 18},
{.pair.left = 26, .pair.right = 19},
{.pair.left = 26, .pair.right = 21},
{.pair.left = 26, .pair.right = 22},
{.pair.left = 26, .pair.right = 23},
{.pair.left = 26, .pair.right = 24},
{.pair.left = 26, .pair.right = 26},
{.pair.left = 34, .pair.right = 36},
{.pair.left = 34, .pair.right = 40},
{.pair.left = 34, .pair.right = 48},
{.pair.left = 34, .pair.right = 50},
{.pair.left = 34, .pair.right = 53},
{.pair.left = 34, .pair.right = 54},
{.pair.left = 34, .pair.right = 55},
{.pair.left = 34, .pair.right = 56},
{.pair.left = 34, .pair.right = 58},
{.pair.left = 34, .pair.right = 66},
{.pair.left = 34, .pair.right = 68},
{.pair.left = 34, .pair.right = 69},
{.pair.left = 34, .pair.right = 70},
{.pair.left = 34, .pair.right = 72},
{.pair.left = 34, .pair.right = 80},
{.pair.left = 34, .pair.right = 82},
{.pair.left = 34, .pair.right = 84},
{.pair.left = 34, .pair.right = 85},
{.pair.left = 34, .pair.right = 86},
{.pair.left = 34, .pair.right = 87},
{.pair.left = 34, .pair.right = 88},
{.pair.left = 34, .pair.right = 91},
{.pair.left = 35, .pair.right = 58},
{.pair.left = 35, .pair.right = 66},
{.pair.left = 35, .pair.right = 74},
{.pair.left = 35, .pair.right = 77},
{.pair.left = 35, .pair.right = 80},
{.pair.left = 35, .pair.right = 83},
{.pair.left = 35, .pair.right = 86},
{.pair.left = 35, .pair.right = 90},
{.pair.left = 36, .pair.right = 36},
{.pair.left = 36, .pair.right = 40},
{.pair.left = 36, .pair.right = 48},
{.pair.left = 36, .pair.right = 50},
{.pair.left = 36, .pair.right = 74},
{.pair.left = 36, .pair.right = 83},
{.pair.left = 36, .pair.right = 86},
{.pair.left = 36, .pair.right = 90},
{.pair.left = 36, .pair.right = 91},
{.pair.left = 37, .pair.right = 55},
{.pair.left = 37, .pair.right = 56},
{.pair.left = 37, .pair.right = 66},
{.pair.left = 37, .pair.right = 70},
{.pair.left = 37, .pair.right = 80},
{.pair.left = 37, .pair.right = 86},
{.pair.left = 38, .pair.right = 55},
{.pair.left = 38, .pair.right = 56},
{.pair.left = 38, .pair.right = 58},
{.pair.left = 38, .pair.right = 67},
{.pair.left = 38, .pair.right = 68},
{.pair.left = 38, .pair.right = 69},
{.pair.left = 38, .pair.right = 70},
{.pair.left = 38, .pair.right = 71},
{.pair.left = 38, .pair.right = 72},
{.pair.left = 38, .pair.right = 74},
{.pair.left = 38, .pair.right = 75},
{.pair.left = 38, .pair.right = 76},
{.pair.left = 38, .pair.right = 77},
{.pair.left = 38, .pair.right = 78},
{.pair.left = 38, .pair.right = 79},
{.pair.left = 38, .pair.right = 80},
{.pair.left = 38, .pair.right = 81},
{.pair.left = 38, .pair.right = 82},
{.pair.left = 38, .pair.right = 83},
{.pair.left = 38, .pair.right = 85},
{.pair.left = 38, .pair.right = 86},
{.pair.left = 38, .pair.right = 87},
{.pair.left = 38, .pair.right = 88},
{.pair.left = 38, .pair.right = 89},
{.pair.left = 38, .pair.right = 90},
{.pair.left = 38, .pair.right = 91},
{.pair.left = 39, .pair.right = 13},
{.pair.left = 39, .pair.right = 15},
{.pair.left = 39, .pair.right = 34},
{.pair.left = 39, .pair.right = 66},
{.pair.left = 39, .pair.right = 70},
{.pair.left = 39, .pair.right = 74},
{.pair.left = 39, .pair.right = 77},
{.pair.left = 39, .pair.right = 80},
{.pair.left = 39, .pair.right = 83},
{.pair.left = 39, .pair.right = 86},
{.pair.left = 39, .pair.right = 90},
{.pair.left = 40, .pair.right = 66},
{.pair.left = 40, .pair.right = 70},
{.pair.left = 40, .pair.right = 79},
{.pair.left = 40, .pair.right = 80},
{.pair.left = 40, .pair.right = 83},
{.pair.left = 40, .pair.right = 86},
{.pair.left = 40, .pair.right = 90},
{.pair.left = 41, .pair.right = 66},
{.pair.left = 41, .pair.right = 70},
{.pair.left = 41, .pair.right = 80},
{.pair.left = 41, .pair.right = 86},
{.pair.left = 41, .pair.right = 90},
{.pair.left = 42, .pair.right = 66},
{.pair.left = 42, .pair.right = 68},
{.pair.left = 42, .pair.right = 69},
{.pair.left = 42, .pair.right = 71},
{.pair.left = 42, .pair.right = 72},
{.pair.left = 42, .pair.right = 78},
{.pair.left = 42, .pair.right = 79},
{.pair.left = 42, .pair.right = 80},
{.pair.left = 42, .pair.right = 81},
{.pair.left = 42, .pair.right = 83},
{.pair.left = 42, .pair.right = 84},
{.pair.left = 42, .pair.right = 85},
{.pair.left = 42, .pair.right = 86},
{.pair.left = 42, .pair.right = 87},
{.pair.left = 42, .pair.right = 88},
{.pair.left = 42, .pair.right = 90},
{.pair.left = 43, .pair.right = 66},
{.pair.left = 43, .pair.right = 80},
{.pair.left = 44, .pair.right = 36},
{.pair.left = 44, .pair.right = 40},
{.pair.left = 44, .pair.right = 48},
{.pair.left = 44, .pair.right = 50},
{.pair.left = 44, .pair.right = 66},
{.pair.left = 44, .pair.right = 70},
{.pair.left = 44, .pair.right = 74},
{.pair.left = 44, .pair.right = 80},
{.pair.left = 44, .pair.right = 83},
{.pair.left = 44, .pair.right = 86},
{.pair.left = 44, .pair.right = 88},
{.pair.left = 44, .pair.right = 90},
{.pair.left = 45, .pair.right = 34},
{.pair.left = 45, .pair.right = 36},
{.pair.left = 45, .pair.right = 40},
{.pair.left = 45, .pair.right = 48},
{.pair.left = 45, .pair.right = 50},
{.pair.left = 45, .pair.right = 53},
{.pair.left = 45, .pair.right = 54},
{.pair.left = 45, .pair.right = 55},
{.pair.left = 45, .pair.right = 56},
{.pair.left = 45, .pair.right = 58},
{.pair.left = 45, .pair.right = 75},
{.pair.left = 45, .pair.right = 86},
{.pair.left = 45, .pair.right = 88},
{.pair.left = 45, .pair.right = 90},
{.pair.left = 46, .pair.right = 66},
{.pair.left = 46, .pair.right = 70},
{.pair.left = 46, .pair.right = 75},
{.pair.left = 46, .pair.right = 79},
{.pair.left = 46, .pair.right = 80},
{.pair.left = 46, .pair.right = 86},
{.pair.left = 46, .pair.right = 90},
{.pair.left = 47, .pair.right = 70},
{.pair.left = 47, .pair.right = 80},
{.pair.left = 47, .pair.right = 90},
{.pair.left = 48, .pair.right = 34},
{.pair.left = 48, .pair.right = 53},
{.pair.left = 48, .pair.right = 55},
{.pair.left = 48, .pair.right = 56},
{.pair.left = 48, .pair.right = 57},
{.pair.left = 48, .pair.right = 58},
{.pair.left = 48, .pair.right = 68},
{.pair.left = 48, .pair.right = 69},
{.pair.left = 48, .pair.right = 70},
{.pair.left = 48, .pair.right = 71},
{.pair.left = 48, .pair.right = 72},
{.pair.left = 48, .pair.right = 75},
{.pair.left = 48, .pair.right = 80},
{.pair.left = 48, .pair.right = 81},
{.pair.left = 48, .pair.right = 82},
{.pair.left = 48, .pair.right = 84},
{.pair.left = 48, .pair.right = 85},
{.pair.left = 48, .pair.right = 86},
{.pair.left = 48, .pair.right = 89},
{.pair.left = 48, .pair.right = 90},
{.pair.left = 48, .pair.right = 91},
{.pair.left = 49, .pair.right = 13},
{.pair.left = 49, .pair.right = 15},
{.pair.left = 49, .pair.right = 34},
{.pair.left = 49, .pair.right = 38},
{.pair.left = 49, .pair.right = 41},
{.pair.left = 49, .pair.right = 42},
{.pair.left = 49, .pair.right = 66},
{.pair.left = 49, .pair.right = 70},
{.pair.left = 49, .pair.right = 73},
{.pair.left = 49, .pair.right = 74},
{.pair.left = 49, .pair.right = 77},
{.pair.left = 49, .pair.right = 79},
{.pair.left = 49, .pair.right = 80},
{.pair.left = 49, .pair.right = 83},
{.pair.left = 49, .pair.right = 84},
{.pair.left = 49, .pair.right = 85},
{.pair.left = 49, .pair.right = 90},
{.pair.left = 50, .pair.right = 34},
{.pair.left = 50, .pair.right = 53},
{.pair.left = 50, .pair.right = 54},
{.pair.left = 50, .pair.right = 55},
{.pair.left = 50, .pair.right = 56},
{.pair.left = 50, .pair.right = 57},
{.pair.left = 50, .pair.right = 58},
{.pair.left = 50, .pair.right = 66},
{.pair.left = 50, .pair.right = 86},
{.pair.left = 51, .pair.right = 36},
{.pair.left = 51, .pair.right = 40},
{.pair.left = 51, .pair.right = 48},
{.pair.left = 51, .pair.right = 50},
{.pair.left = 51, .pair.right = 53},
{.pair.left = 51, .pair.right = 54},
{.pair.left = 51, .pair.right = 55},
{.pair.left = 51, .pair.right = 56},
{.pair.left = 51, .pair.right = 58},
{.pair.left = 51, .pair.right = 66},
{.pair.left = 51, .pair.right = 70},
{.pair.left = 51, .pair.right = 80},
{.pair.left = 51, .pair.right = 86},
{.pair.left = 51, .pair.right = 90},
{.pair.left = 52, .pair.right = 66},
{.pair.left = 52, .pair.right = 70},
{.pair.left = 52, .pair.right = 75},
{.pair.left = 52, .pair.right = 78},
{.pair.left = 52, .pair.right = 79},
{.pair.left = 52, .pair.right = 80},
{.pair.left = 52, .pair.right = 81},
{.pair.left = 52, .pair.right = 82},
{.pair.left = 52, .pair.right = 86},
{.pair.left = 52, .pair.right = 88},
{.pair.left = 52, .pair.right = 90},
{.pair.left = 53, .pair.right = 13},
{.pair.left = 53, .pair.right = 14},
{.pair.left = 53, .pair.right = 15},
{.pair.left = 53, .pair.right = 27},
{.pair.left = 53, .pair.right = 28},
{.pair.left = 53, .pair.right = 34},
{.pair.left = 53, .pair.right = 36},
{.pair.left = 53, .pair.right = 40},
{.pair.left = 53, .pair.right = 48},
{.pair.left = 53, .pair.right = 50},
{.pair.left = 53, .pair.right = 52},
{.pair.left = 53, .pair.right = 53},
{.pair.left = 53, .pair.right = 55},
{.pair.left = 53, .pair.right = 56},
{.pair.left = 53, .pair.right = 57},
{.pair.left = 53, .pair.right = 58},
{.pair.left = 53, .pair.right = 66},
{.pair.left = 53, .pair.right = 70},
{.pair.left = 53, .pair.right = 74},
{.pair.left = 53, .pair.right = 78},
{.pair.left = 53, .pair.right = 80},
{.pair.left = 53, .pair.right = 83},
{.pair.left = 53, .pair.right = 84},
{.pair.left = 53, .pair.right = 86},
{.pair.left = 53, .pair.right = 88},
{.pair.left = 53, .pair.right = 90},
{.pair.left = 53, .pair.right = 91},
{.pair.left = 54, .pair.right = 34},
{.pair.left = 54, .pair.right = 69},
{.pair.left = 54, .pair.right = 71},
{.pair.left = 54, .pair.right = 72},
{.pair.left = 54, .pair.right = 78},
{.pair.left = 54, .pair.right = 79},
{.pair.left = 54, .pair.right = 81},
{.pair.left = 54, .pair.right = 83},
{.pair.left = 54, .pair.right = 84},
{.pair.left = 54, .pair.right = 85},
{.pair.left = 54, .pair.right = 89},
{.pair.left = 54, .pair.right = 91},
{.pair.left = 55, .pair.right = 10},
{.pair.left = 55, .pair.right = 13},
{.pair.left = 55, .pair.right = 14},
{.pair.left = 55, .pair.right = 15},
{.pair.left = 55, .pair.right = 27},
{.pair.left = 55, .pair.right = 28},
{.pair.left = 55, .pair.right = 34},
{.pair.left = 55, .pair.right = 36},
{.pair.left = 55, .pair.right = 40},
{.pair.left = 55, .pair.right = 48},
{.pair.left = 55, .pair.right = 50},
{.pair.left = 55, .pair.right = 62},
{.pair.left = 55, .pair.right = 66},
{.pair.left = 55, .pair.right = 70},
{.pair.left = 55, .pair.right = 80},
{.pair.left = 55, .pair.right = 83},
{.pair.left = 55, .pair.right = 86},
{.pair.left = 55, .pair.right = 90},
{.pair.left = 55, .pair.right = 94},
{.pair.left = 56, .pair.right = 10},
{.pair.left = 56, .pair.right = 13},
{.pair.left = 56, .pair.right = 14},
{.pair.left = 56, .pair.right = 15},
{.pair.left = 56, .pair.right = 27},
{.pair.left = 56, .pair.right = 28},
{.pair.left = 56, .pair.right = 34},
{.pair.left = 56, .pair.right = 36},
{.pair.left = 56, .pair.right = 40},
{.pair.left = 56, .pair.right = 48},
{.pair.left = 56, .pair.right = 50},
{.pair.left = 56, .pair.right = 53},
{.pair.left = 56, .pair.right = 62},
{.pair.left = 56, .pair.right = 66},
{.pair.left = 56, .pair.right = 70},
{.pair.left = 56, .pair.right = 80},
{.pair.left = 56, .pair.right = 83},
{.pair.left = 56, .pair.right = 86},
{.pair.left = 56, .pair.right = 90},
{.pair.left = 56, .pair.right = 94},
{.pair.left = 57, .pair.right = 36},
{.pair.left = 57, .pair.right = 40},
{.pair.left = 57, .pair.right = 48},
{.pair.left = 57, .pair.right = 50},
{.pair.left = 57, .pair.right = 70},
{.pair.left = 57, .pair.right = 86},
{.pair.left = 57, .pair.right = 90},
{.pair.left = 58, .pair.right = 10},
{.pair.left = 58, .pair.right = 13},
{.pair.left = 58, .pair.right = 14},
{.pair.left = 58, .pair.right = 15},
{.pair.left = 58, .pair.right = 27},
{.pair.left = 58, .pair.right = 28},
{.pair.left = 58, .pair.right = 34},
{.pair.left = 58, .pair.right = 36},
{.pair.left = 58, .pair.right = 40},
{.pair.left = 58, .pair.right = 48},
{.pair.left = 58, .pair.right = 50},
{.pair.left = 58, .pair.right = 53},
{.pair.left = 58, .pair.right = 55},
{.pair.left = 58, .pair.right = 56},
{.pair.left = 58, .pair.right = 57},
{.pair.left = 58, .pair.right = 58},
{.pair.left = 58, .pair.right = 62},
{.pair.left = 58, .pair.right = 66},
{.pair.left = 58, .pair.right = 70},
{.pair.left = 58, .pair.right = 80},
{.pair.left = 58, .pair.right = 82},
{.pair.left = 58, .pair.right = 85},
{.pair.left = 58, .pair.right = 86},
{.pair.left = 58, .pair.right = 87},
{.pair.left = 58, .pair.right = 94},
{.pair.left = 59, .pair.right = 34},
{.pair.left = 59, .pair.right = 36},
{.pair.left = 59, .pair.right = 40},
{.pair.left = 59, .pair.right = 48},
{.pair.left = 59, .pair.right = 50},
{.pair.left = 59, .pair.right = 66},
{.pair.left = 59, .pair.right = 70},
{.pair.left = 59, .pair.right = 74},
{.pair.left = 59, .pair.right = 80},
{.pair.left = 59, .pair.right = 86},
{.pair.left = 59, .pair.right = 88},
{.pair.left = 59, .pair.right = 90},
{.pair.left = 60, .pair.right = 43},
{.pair.left = 67, .pair.right = 87},
{.pair.left = 67, .pair.right = 88},
{.pair.left = 67, .pair.right = 90},
{.pair.left = 70, .pair.right = 90},
{.pair.left = 71, .pair.right = 3},
{.pair.left = 71, .pair.right = 8},
{.pair.left = 71, .pair.right = 10},
{.pair.left = 71, .pair.right = 62},
{.pair.left = 71, .pair.right = 72},
{.pair.left = 71, .pair.right = 94},
{.pair.left = 76, .pair.right = 70},
{.pair.left = 80, .pair.right = 87},
{.pair.left = 80, .pair.right = 88},
{.pair.left = 80, .pair.right = 89},
{.pair.left = 80, .pair.right = 90},
{.pair.left = 81, .pair.right = 88},
{.pair.left = 83, .pair.right = 13},
{.pair.left = 83, .pair.right = 15},
{.pair.left = 83, .pair.right = 68},
{.pair.left = 83, .pair.right = 69},
{.pair.left = 83, .pair.right = 70},
{.pair.left = 83, .pair.right = 71},
{.pair.left = 83, .pair.right = 76},
{.pair.left = 83, .pair.right = 80},
{.pair.left = 83, .pair.right = 82},
{.pair.left = 83, .pair.right = 85},
{.pair.left = 83, .pair.right = 86},
{.pair.left = 83, .pair.right = 87},
{.pair.left = 83, .pair.right = 88},
{.pair.left = 83, .pair.right = 89},
{.pair.left = 83, .pair.right = 90},
{.pair.left = 83, .pair.right = 91},
{.pair.left = 87, .pair.right = 13},
{.pair.left = 87, .pair.right = 15},
{.pair.left = 87, .pair.right = 66},
{.pair.left = 87, .pair.right = 68},
{.pair.left = 87, .pair.right = 69},
{.pair.left = 87, .pair.right = 70},
{.pair.left = 87, .pair.right = 80},
{.pair.left = 87, .pair.right = 82},
{.pair.left = 88, .pair.right = 13},
{.pair.left = 88, .pair.right = 15},
{.pair.left = 88, .pair.right = 68},
{.pair.left = 88, .pair.right = 69},
{.pair.left = 88, .pair.right = 70},
{.pair.left = 88, .pair.right = 82},
{.pair.left = 89, .pair.right = 68},
{.pair.left = 89, .pair.right = 69},
{.pair.left = 89, .pair.right = 70},
{.pair.left = 89, .pair.right = 80},
{.pair.left = 89, .pair.right = 82},
{.pair.left = 90, .pair.right = 13},
{.pair.left = 90, .pair.right = 15},
{.pair.left = 90, .pair.right = 68},
{.pair.left = 90, .pair.right = 69},
{.pair.left = 90, .pair.right = 70},
{.pair.left = 90, .pair.right = 80},
{.pair.left = 90, .pair.right = 82},
{.pair.left = 91, .pair.right = 68},
{.pair.left = 91, .pair.right = 69},
{.pair.left = 91, .pair.right = 70},
{.pair.left = 91, .pair.right = 80},
{.pair.left = 92, .pair.right = 43}
9, 43,
9, 55,
9, 56,
};
/* Kerning between the respective left and right glyphs
* 4.4 format which needs to scaled with `kern_scale`*/
static int8_t kern_pair_values[] =
static const int8_t kern_pair_values[] =
{
-12, 5, 5, 6, 1, -4, 0, 1,
0, 1, -5, 1, -1, -1, -1, 0,
@ -1065,29 +577,28 @@ static lv_font_fmt_txt_kern_pair_t kern_pairs =
.glyph_ids = kern_pair_glyph_ids,
.values = kern_pair_values,
.pair_cnt = 484,
.glyph_ids_size = 1,
};
/*--------------------
* ALL CUSTOM DATA
*--------------------*/
/*Store all the custom data of the font*/
static lv_font_dsc_fmt_txt_t font_dsc = {
static lv_font_fmt_txt_dsc_t font_dsc = {
.glyph_bitmap = gylph_bitmap,
.glyph_dsc = glyph_dsc,
.cmaps = cmaps,
.cmap_num = 1,
.bpp = 1,
.kerning_scale = 16,
//.kern_dsc = kern_classes,
.kern_scale = 16,
//.kern_dsc = &kern_classes,
//.kern_classes = 1,
.kern_dsc = kern_pairs,
.kern_dsc = &kern_pairs,
.kern_classes = 0,
};
/*-----------------
* PUBLIC FONT
*----------------*/

View File

@ -78,17 +78,29 @@ bool lv_font_get_glyph_dsc_fmt_txt(const lv_font_t * font, lv_font_glyph_dsc_t *
uint32_t k;
if(fdsc->kern_classes == 0) {
const lv_font_fmt_txt_kern_pair_t * kdsc = fdsc->kern_dsc;
for(k = 0; k < kdsc->pair_cnt; k++) {
if(kdsc->glyph_ids[k].pair.left == unicode_letter &&
kdsc->glyph_ids[k].pair.right == unicode_letter_next) {
kvalue = kdsc->values[k];
break;
if(kdsc->glyph_ids_size == 1) {
const uint8_t * g_ids = kdsc->glyph_ids;
for(k = 0; k < kdsc->pair_cnt * 2; k += 2) {
if(g_ids[k] == unicode_letter &&
g_ids[k+1] == unicode_letter_next) {
kvalue = kdsc->values[k >> 1];
break;
}
}
} else {
const uint16_t * g_ids = kdsc->glyph_ids;
for(k = 0; k < kdsc->pair_cnt * 2; k += 2) {
if(g_ids[k] == unicode_letter &&
g_ids[k+1] == unicode_letter_next) {
kvalue = kdsc->values[k >> 1];
break;
}
}
}
}
uint32_t adw_w = gdsc->adv_w + ((kvalue * fdsc->kern_scale) >> 4);
adw_w =(adw_w + (1 << 3)) >> 4;
adw_w = (adw_w + (1 << 3)) >> 4;
dsc_out->adv_w = adw_w;
dsc_out->box_h = gdsc->box_h;

View File

@ -114,13 +114,13 @@ typedef struct {
typedef struct {
/*To get a kern value of two code points:
1. Get the `glyph_id_left` and `glyph_id_right` from `lv_font_fmt_txt_cmap_t
2 for(i = 0; i < pair_cnt; i+2)
2 for(i = 0; i < pair_cnt * 2; i+2)
if(gylph_ids[i] == glyph_id_left &&
gylph_ids[i+1] == glyph_id_right)
return values[i / 2];
*/
const void * glyph_ids;
const uint8_t * values;
const int8_t * values;
uint32_t pair_cnt :24;
uint32_t glyph_ids_size :2; /*1: `glyph_ids` is stored as `uint8_t`; 2: as `uint16_t`*/
}lv_font_fmt_txt_kern_pair_t;