mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-28 07:03:00 +08:00
font: add LV_FONT_X4_SET
This commit is contained in:
parent
ceff78476b
commit
1ed8207b5c
@ -42,9 +42,9 @@ static const uint8_t gylph_bitmap[] = {
|
|||||||
*--------------------*/
|
*--------------------*/
|
||||||
|
|
||||||
static lv_font_glyph_dsc_fmt_txt_t glyph_dsc[] = {
|
static lv_font_glyph_dsc_fmt_txt_t glyph_dsc[] = {
|
||||||
{.bitmap_index = 0, .adv_w = 123, .box_h = 13, .box_w = 9, .ofs_x = 2, .ofs_y = 5},
|
{.bitmap_index = 0, .adv_w = LV_FONT_X4_SET(12, 3), .box_h = 13, .box_w = 9, .ofs_x = 2, .ofs_y = 5},
|
||||||
{.bitmap_index = 32, .adv_w = 234, .box_h = 12, .box_w = 7, .ofs_x = 1, .ofs_y = 3},
|
{.bitmap_index = 32, .adv_w = LV_FONT_X4_SET(8, 7), .box_h = 12, .box_w = 7, .ofs_x = 1, .ofs_y = 3},
|
||||||
{.bitmap_index = 55, .adv_w = 98, .box_h = 11, .box_w = 8, .ofs_x = 0, .ofs_y = 4},
|
{.bitmap_index = 55, .adv_w = LV_FONT_X4_SET(4, 11), .box_h = 11, .box_w = 8, .ofs_x = 0, .ofs_y = 4},
|
||||||
};
|
};
|
||||||
|
|
||||||
/*---------------------
|
/*---------------------
|
||||||
@ -113,7 +113,7 @@ static uint8_t kern_right_class_mapping[] =
|
|||||||
/*Kern values between classes*/
|
/*Kern values between classes*/
|
||||||
static uint8_t kern_class_values =
|
static uint8_t kern_class_values =
|
||||||
{
|
{
|
||||||
32, 33, 22, 11, 55, 33, 22, 44
|
LV_FONT_X4_SET(2, 7), LV_FONT_X4_SET(-1, 3), LV_FONT_X4_SET(0, 13), LV_FONT_X4_SET(5, 7)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -140,6 +140,7 @@ static lv_font_dsc_fmt_txt_t font_dsc = {
|
|||||||
.cmap_num = 3,
|
.cmap_num = 3,
|
||||||
.bpp = 4,
|
.bpp = 4,
|
||||||
|
|
||||||
|
.kerning_scale = 324,
|
||||||
.kern_dsc = kern_classes,
|
.kern_dsc = kern_classes,
|
||||||
.kern_classes = 1,
|
.kern_classes = 1,
|
||||||
/*** OR ***/
|
/*** OR ***/
|
||||||
|
@ -193,6 +193,9 @@ bool lv_font_get_glyph_dsc_format_text_plain(const lv_font_t * font, lv_font_gly
|
|||||||
/**********************
|
/**********************
|
||||||
* MACROS
|
* MACROS
|
||||||
**********************/
|
**********************/
|
||||||
|
#define LV_FONT_X4_SET(_int, _fract) ((_int << 4) + _fract)
|
||||||
|
#define LV_FONT_X4_INT(_num) (_num >> 4)
|
||||||
|
#define LV_FONT_X4_FRACT(_num) (_num & 0xF)
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* ADD BUILT IN FONTS
|
* ADD BUILT IN FONTS
|
||||||
|
Loading…
x
Reference in New Issue
Block a user