diff --git a/src/lv_font/lv_font_roboto_16.c b/src/lv_font/lv_font_roboto_16.c index a52b2c0dcf..bf0673e968 100644 --- a/src/lv_font/lv_font_roboto_16.c +++ b/src/lv_font/lv_font_roboto_16.c @@ -1,9 +1,9 @@ -#include "../../lvgl.h" +#include "lvgl/lvgl.h" /******************************************************************************* * Size: 16 px * Bpp: 4 - * Opts: --no-compress --no-prefilter --bpp 4 --size 16 --font Roboto-Regular.woff -r 0x20-0x7F --font FontAwesome5-Solid+Brands+Regular.woff -r 61441,61448,61451,61452,61452,61453,61457,61459,61461,61465,61468,61473,61478,61479,61480,61502,61512,61515,61516,61517,61521,61522,61523,61524,61543,61544,61550,61552,61553,61556,61559,61560,61561,61563,61587,61589,61636,61637,61639,61671,61674,61683,61724,61732,61787,61931,62016,62017,62018,62019,62020,62087,62099,62212,62189,62810,63426,63650 --format lvgl -o lv_font_roboto_16.c --force-fast-kern-format + * Opts: ******************************************************************************/ #ifndef LV_FONT_ROBOTO_16 @@ -744,6 +744,9 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { 0x6c, 0xac, 0x5a, 0xf6, 0x2c, 0x8d, 0x50, 0x7, 0xff, 0xc1, 0x0, 0x0, 0x1, 0x30, 0x0, + /* U+2022 "•" */ + 0x3a, 0x70, 0xdf, 0xf2, 0xef, 0xf3, 0x7f, 0xb0, + /* U+F001 "" */ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x49, 0xdc, @@ -1747,63 +1750,64 @@ static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { {.bitmap_index = 3938, .adv_w = 62, .box_w = 2, .box_h = 14, .ofs_x = 1, .ofs_y = -2}, {.bitmap_index = 3952, .adv_w = 87, .box_w = 5, .box_h = 17, .ofs_x = 0, .ofs_y = -3}, {.bitmap_index = 3995, .adv_w = 174, .box_w = 9, .box_h = 5, .ofs_x = 1, .ofs_y = 3}, - {.bitmap_index = 4018, .adv_w = 256, .box_w = 16, .box_h = 17, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 4154, .adv_w = 256, .box_w = 16, .box_h = 12, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 4250, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 4362, .adv_w = 256, .box_w = 16, .box_h = 12, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 4458, .adv_w = 176, .box_w = 11, .box_h = 12, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 4524, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 4652, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 4780, .adv_w = 288, .box_w = 18, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 4906, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 5034, .adv_w = 288, .box_w = 18, .box_h = 12, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 5142, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 5270, .adv_w = 128, .box_w = 8, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 5326, .adv_w = 192, .box_w = 12, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 5410, .adv_w = 288, .box_w = 18, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 5554, .adv_w = 256, .box_w = 16, .box_h = 12, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 5650, .adv_w = 224, .box_w = 10, .box_h = 16, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 5730, .adv_w = 224, .box_w = 14, .box_h = 18, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 5856, .adv_w = 224, .box_w = 14, .box_h = 15, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 5961, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 6059, .adv_w = 224, .box_w = 10, .box_h = 16, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 6139, .adv_w = 224, .box_w = 16, .box_h = 14, .ofs_x = -1, .ofs_y = -1}, - {.bitmap_index = 6251, .adv_w = 160, .box_w = 10, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 6321, .adv_w = 160, .box_w = 10, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 6391, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 6489, .adv_w = 224, .box_w = 14, .box_h = 4, .ofs_x = 0, .ofs_y = 4}, - {.bitmap_index = 6517, .adv_w = 288, .box_w = 18, .box_h = 12, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 6625, .adv_w = 320, .box_w = 20, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 6785, .adv_w = 288, .box_w = 20, .box_h = 16, .ofs_x = -1, .ofs_y = -2}, - {.bitmap_index = 6945, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 7073, .adv_w = 224, .box_w = 14, .box_h = 10, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 7143, .adv_w = 224, .box_w = 14, .box_h = 10, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 7213, .adv_w = 320, .box_w = 20, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 7353, .adv_w = 256, .box_w = 16, .box_h = 12, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 7449, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 7577, .adv_w = 256, .box_w = 17, .box_h = 17, .ofs_x = -1, .ofs_y = -2}, - {.bitmap_index = 7722, .adv_w = 224, .box_w = 15, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 7827, .adv_w = 224, .box_w = 14, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 7939, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 8037, .adv_w = 160, .box_w = 12, .box_h = 16, .ofs_x = -1, .ofs_y = -2}, - {.bitmap_index = 8133, .adv_w = 224, .box_w = 14, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 8245, .adv_w = 224, .box_w = 14, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 8357, .adv_w = 288, .box_w = 18, .box_h = 12, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 8465, .adv_w = 256, .box_w = 18, .box_h = 18, .ofs_x = -1, .ofs_y = -3}, - {.bitmap_index = 8627, .adv_w = 192, .box_w = 12, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 8723, .adv_w = 320, .box_w = 20, .box_h = 15, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 8873, .adv_w = 320, .box_w = 20, .box_h = 10, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 8973, .adv_w = 320, .box_w = 20, .box_h = 10, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 9073, .adv_w = 320, .box_w = 20, .box_h = 10, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 9173, .adv_w = 320, .box_w = 20, .box_h = 10, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 9273, .adv_w = 320, .box_w = 20, .box_h = 10, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 9373, .adv_w = 320, .box_w = 21, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 9520, .adv_w = 224, .box_w = 12, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 9616, .adv_w = 224, .box_w = 14, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 9728, .adv_w = 256, .box_w = 17, .box_h = 17, .ofs_x = -1, .ofs_y = -3}, - {.bitmap_index = 9873, .adv_w = 320, .box_w = 20, .box_h = 12, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 9993, .adv_w = 192, .box_w = 12, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 10089, .adv_w = 258, .box_w = 17, .box_h = 11, .ofs_x = 0, .ofs_y = 1} + {.bitmap_index = 4018, .adv_w = 86, .box_w = 4, .box_h = 4, .ofs_x = 1, .ofs_y = 4}, + {.bitmap_index = 4026, .adv_w = 256, .box_w = 16, .box_h = 17, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 4162, .adv_w = 256, .box_w = 16, .box_h = 12, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 4258, .adv_w = 256, .box_w = 16, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 4370, .adv_w = 256, .box_w = 16, .box_h = 12, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 4466, .adv_w = 176, .box_w = 11, .box_h = 12, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 4532, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 4660, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 4788, .adv_w = 288, .box_w = 18, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 4914, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 5042, .adv_w = 288, .box_w = 18, .box_h = 12, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 5150, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 5278, .adv_w = 128, .box_w = 8, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 5334, .adv_w = 192, .box_w = 12, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 5418, .adv_w = 288, .box_w = 18, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 5562, .adv_w = 256, .box_w = 16, .box_h = 12, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 5658, .adv_w = 224, .box_w = 10, .box_h = 16, .ofs_x = 2, .ofs_y = -2}, + {.bitmap_index = 5738, .adv_w = 224, .box_w = 14, .box_h = 18, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 5864, .adv_w = 224, .box_w = 14, .box_h = 15, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 5969, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 6067, .adv_w = 224, .box_w = 10, .box_h = 16, .ofs_x = 2, .ofs_y = -2}, + {.bitmap_index = 6147, .adv_w = 224, .box_w = 16, .box_h = 14, .ofs_x = -1, .ofs_y = -1}, + {.bitmap_index = 6259, .adv_w = 160, .box_w = 10, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 6329, .adv_w = 160, .box_w = 10, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 6399, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 6497, .adv_w = 224, .box_w = 14, .box_h = 4, .ofs_x = 0, .ofs_y = 4}, + {.bitmap_index = 6525, .adv_w = 288, .box_w = 18, .box_h = 12, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 6633, .adv_w = 320, .box_w = 20, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 6793, .adv_w = 288, .box_w = 20, .box_h = 16, .ofs_x = -1, .ofs_y = -2}, + {.bitmap_index = 6953, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 7081, .adv_w = 224, .box_w = 14, .box_h = 10, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 7151, .adv_w = 224, .box_w = 14, .box_h = 10, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 7221, .adv_w = 320, .box_w = 20, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 7361, .adv_w = 256, .box_w = 16, .box_h = 12, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 7457, .adv_w = 256, .box_w = 16, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 7585, .adv_w = 256, .box_w = 17, .box_h = 17, .ofs_x = -1, .ofs_y = -2}, + {.bitmap_index = 7730, .adv_w = 224, .box_w = 15, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 7835, .adv_w = 224, .box_w = 14, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 7947, .adv_w = 224, .box_w = 14, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 8045, .adv_w = 160, .box_w = 12, .box_h = 16, .ofs_x = -1, .ofs_y = -2}, + {.bitmap_index = 8141, .adv_w = 224, .box_w = 14, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 8253, .adv_w = 224, .box_w = 14, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 8365, .adv_w = 288, .box_w = 18, .box_h = 12, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 8473, .adv_w = 256, .box_w = 18, .box_h = 18, .ofs_x = -1, .ofs_y = -3}, + {.bitmap_index = 8635, .adv_w = 192, .box_w = 12, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 8731, .adv_w = 320, .box_w = 20, .box_h = 15, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 8881, .adv_w = 320, .box_w = 20, .box_h = 10, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 8981, .adv_w = 320, .box_w = 20, .box_h = 10, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 9081, .adv_w = 320, .box_w = 20, .box_h = 10, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 9181, .adv_w = 320, .box_w = 20, .box_h = 10, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 9281, .adv_w = 320, .box_w = 20, .box_h = 10, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 9381, .adv_w = 320, .box_w = 21, .box_h = 14, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 9528, .adv_w = 224, .box_w = 12, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 9624, .adv_w = 224, .box_w = 14, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 9736, .adv_w = 256, .box_w = 17, .box_h = 17, .ofs_x = -1, .ofs_y = -3}, + {.bitmap_index = 9881, .adv_w = 320, .box_w = 20, .box_h = 12, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 10001, .adv_w = 192, .box_w = 12, .box_h = 16, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 10097, .adv_w = 258, .box_w = 17, .box_h = 11, .ofs_x = 0, .ofs_y = 1} }; /*--------------------- @@ -1811,14 +1815,14 @@ static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { *--------------------*/ static const uint16_t unicode_list_1[] = { - 0x0, 0x7, 0xa, 0xb, 0xc, 0x10, 0x12, 0x14, - 0x18, 0x1b, 0x20, 0x25, 0x26, 0x27, 0x3d, 0x47, - 0x4a, 0x4b, 0x4c, 0x50, 0x51, 0x52, 0x53, 0x66, - 0x67, 0x6d, 0x6f, 0x70, 0x73, 0x76, 0x77, 0x78, - 0x7a, 0x92, 0x94, 0xc3, 0xc4, 0xc6, 0xe6, 0xe9, - 0xf2, 0x11b, 0x123, 0x15a, 0x1ea, 0x23f, 0x240, 0x241, - 0x242, 0x243, 0x286, 0x292, 0x2ec, 0x303, 0x559, 0x7c1, - 0x8a1 + 0x0, 0xcfdf, 0xcfe6, 0xcfe9, 0xcfea, 0xcfeb, 0xcfef, 0xcff1, + 0xcff3, 0xcff7, 0xcffa, 0xcfff, 0xd004, 0xd005, 0xd006, 0xd01c, + 0xd026, 0xd029, 0xd02a, 0xd02b, 0xd02f, 0xd030, 0xd031, 0xd032, + 0xd045, 0xd046, 0xd04c, 0xd04e, 0xd04f, 0xd052, 0xd055, 0xd056, + 0xd057, 0xd059, 0xd071, 0xd073, 0xd0a2, 0xd0a3, 0xd0a5, 0xd0c5, + 0xd0c8, 0xd0d1, 0xd0fa, 0xd102, 0xd139, 0xd1c9, 0xd21e, 0xd21f, + 0xd220, 0xd221, 0xd222, 0xd265, 0xd271, 0xd2cb, 0xd2e2, 0xd538, + 0xd7a0, 0xd880 }; /*Collect the unicode lists and glyph_id offsets*/ @@ -1829,8 +1833,8 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = .unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY }, { - .range_start = 61441, .range_length = 2210, .glyph_id_start = 96, - .unicode_list = unicode_list_1, .glyph_id_ofs_list = NULL, .list_length = 57, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY + .range_start = 8226, .range_length = 55425, .glyph_id_start = 96, + .unicode_list = unicode_list_1, .glyph_id_ofs_list = NULL, .list_length = 58, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY } }; @@ -1839,245 +1843,514 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = *----------------*/ -/*Map glyph_ids to kern left classes*/ -static const uint8_t kern_left_class_mapping[] = +/*Pair left and right glyphs for kerning*/ +static const uint8_t kern_pair_glyph_ids[] = { - 0, 1, 0, 2, 0, 0, 0, 0, - 2, 3, 0, 0, 0, 4, 0, 4, - 5, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 6, 7, 8, 9, 10, 11, - 0, 12, 12, 13, 14, 15, 12, 12, - 9, 16, 17, 18, 0, 19, 13, 20, - 21, 22, 23, 24, 25, 0, 0, 0, - 0, 0, 26, 27, 28, 0, 29, 30, - 0, 31, 0, 0, 32, 0, 31, 31, - 33, 27, 0, 34, 0, 35, 0, 36, - 37, 38, 36, 39, 40, 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, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0 + 1, 53, + 3, 3, + 3, 8, + 3, 34, + 3, 66, + 3, 68, + 3, 69, + 3, 70, + 3, 72, + 3, 78, + 3, 79, + 3, 80, + 3, 81, + 3, 82, + 3, 84, + 3, 88, + 8, 3, + 8, 8, + 8, 34, + 8, 66, + 8, 68, + 8, 69, + 8, 70, + 8, 72, + 8, 78, + 8, 79, + 8, 80, + 8, 81, + 8, 82, + 8, 84, + 8, 88, + 9, 55, + 9, 56, + 9, 58, + 13, 3, + 13, 8, + 15, 3, + 15, 8, + 16, 16, + 34, 3, + 34, 8, + 34, 32, + 34, 36, + 34, 40, + 34, 48, + 34, 50, + 34, 53, + 34, 54, + 34, 55, + 34, 56, + 34, 58, + 34, 80, + 34, 85, + 34, 86, + 34, 87, + 34, 88, + 34, 90, + 34, 91, + 35, 53, + 35, 55, + 35, 58, + 36, 10, + 36, 53, + 36, 62, + 36, 94, + 37, 13, + 37, 15, + 37, 34, + 37, 53, + 37, 55, + 37, 57, + 37, 58, + 37, 59, + 38, 53, + 38, 68, + 38, 69, + 38, 70, + 38, 71, + 38, 72, + 38, 80, + 38, 82, + 38, 86, + 38, 87, + 38, 88, + 38, 90, + 39, 13, + 39, 15, + 39, 34, + 39, 43, + 39, 53, + 39, 66, + 39, 68, + 39, 69, + 39, 70, + 39, 72, + 39, 80, + 39, 82, + 39, 83, + 39, 86, + 39, 87, + 39, 90, + 41, 34, + 41, 53, + 41, 57, + 41, 58, + 42, 34, + 42, 53, + 42, 57, + 42, 58, + 43, 34, + 44, 14, + 44, 36, + 44, 40, + 44, 48, + 44, 50, + 44, 68, + 44, 69, + 44, 70, + 44, 72, + 44, 78, + 44, 79, + 44, 80, + 44, 81, + 44, 82, + 44, 86, + 44, 87, + 44, 88, + 44, 90, + 45, 3, + 45, 8, + 45, 34, + 45, 36, + 45, 40, + 45, 48, + 45, 50, + 45, 53, + 45, 54, + 45, 55, + 45, 56, + 45, 58, + 45, 86, + 45, 87, + 45, 88, + 45, 90, + 46, 34, + 46, 53, + 46, 57, + 46, 58, + 47, 34, + 47, 53, + 47, 57, + 47, 58, + 48, 13, + 48, 15, + 48, 34, + 48, 53, + 48, 55, + 48, 57, + 48, 58, + 48, 59, + 49, 13, + 49, 15, + 49, 34, + 49, 43, + 49, 57, + 49, 59, + 49, 66, + 49, 68, + 49, 69, + 49, 70, + 49, 72, + 49, 80, + 49, 82, + 49, 85, + 49, 87, + 49, 90, + 50, 53, + 50, 55, + 50, 56, + 50, 58, + 51, 53, + 51, 55, + 51, 58, + 53, 1, + 53, 13, + 53, 14, + 53, 15, + 53, 34, + 53, 36, + 53, 40, + 53, 43, + 53, 48, + 53, 50, + 53, 52, + 53, 53, + 53, 55, + 53, 56, + 53, 58, + 53, 66, + 53, 68, + 53, 69, + 53, 70, + 53, 72, + 53, 78, + 53, 79, + 53, 80, + 53, 81, + 53, 82, + 53, 83, + 53, 84, + 53, 86, + 53, 87, + 53, 88, + 53, 89, + 53, 90, + 53, 91, + 54, 34, + 55, 10, + 55, 13, + 55, 14, + 55, 15, + 55, 34, + 55, 36, + 55, 40, + 55, 48, + 55, 50, + 55, 62, + 55, 66, + 55, 68, + 55, 69, + 55, 70, + 55, 72, + 55, 80, + 55, 82, + 55, 83, + 55, 86, + 55, 87, + 55, 90, + 55, 94, + 56, 10, + 56, 13, + 56, 14, + 56, 15, + 56, 34, + 56, 53, + 56, 62, + 56, 66, + 56, 68, + 56, 69, + 56, 70, + 56, 72, + 56, 80, + 56, 82, + 56, 83, + 56, 86, + 56, 94, + 57, 14, + 57, 36, + 57, 40, + 57, 48, + 57, 50, + 57, 55, + 57, 68, + 57, 69, + 57, 70, + 57, 72, + 57, 80, + 57, 82, + 57, 86, + 57, 87, + 57, 90, + 58, 7, + 58, 10, + 58, 11, + 58, 13, + 58, 14, + 58, 15, + 58, 34, + 58, 36, + 58, 40, + 58, 43, + 58, 48, + 58, 50, + 58, 52, + 58, 53, + 58, 54, + 58, 55, + 58, 56, + 58, 57, + 58, 58, + 58, 62, + 58, 66, + 58, 68, + 58, 69, + 58, 70, + 58, 71, + 58, 72, + 58, 78, + 58, 79, + 58, 80, + 58, 81, + 58, 82, + 58, 83, + 58, 84, + 58, 85, + 58, 86, + 58, 87, + 58, 89, + 58, 90, + 58, 91, + 58, 94, + 58, 96, + 59, 34, + 59, 36, + 59, 40, + 59, 48, + 59, 50, + 59, 68, + 59, 69, + 59, 70, + 59, 72, + 59, 80, + 59, 82, + 59, 86, + 59, 87, + 59, 88, + 59, 90, + 60, 43, + 60, 54, + 66, 3, + 66, 8, + 66, 87, + 66, 90, + 67, 3, + 67, 8, + 67, 87, + 67, 89, + 67, 90, + 67, 91, + 68, 3, + 68, 8, + 70, 3, + 70, 8, + 70, 87, + 70, 90, + 71, 3, + 71, 8, + 71, 10, + 71, 62, + 71, 68, + 71, 69, + 71, 70, + 71, 72, + 71, 82, + 71, 94, + 73, 3, + 73, 8, + 76, 68, + 76, 69, + 76, 70, + 76, 72, + 76, 82, + 78, 3, + 78, 8, + 79, 3, + 79, 8, + 80, 3, + 80, 8, + 80, 87, + 80, 89, + 80, 90, + 80, 91, + 81, 3, + 81, 8, + 81, 87, + 81, 89, + 81, 90, + 81, 91, + 83, 3, + 83, 8, + 83, 13, + 83, 15, + 83, 66, + 83, 68, + 83, 69, + 83, 70, + 83, 71, + 83, 72, + 83, 80, + 83, 82, + 83, 85, + 83, 87, + 83, 88, + 83, 90, + 85, 80, + 87, 3, + 87, 8, + 87, 13, + 87, 15, + 87, 66, + 87, 68, + 87, 69, + 87, 70, + 87, 71, + 87, 72, + 87, 80, + 87, 82, + 88, 13, + 88, 15, + 89, 68, + 89, 69, + 89, 70, + 89, 72, + 89, 80, + 89, 82, + 90, 3, + 90, 8, + 90, 13, + 90, 15, + 90, 66, + 90, 68, + 90, 69, + 90, 70, + 90, 71, + 90, 72, + 90, 80, + 90, 82, + 91, 68, + 91, 69, + 91, 70, + 91, 72, + 91, 80, + 91, 82, + 92, 43, + 92, 54 }; -/*Map glyph_ids to kern right classes*/ -static const uint8_t kern_right_class_mapping[] = +/* 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[] = { - 0, 1, 0, 2, 0, 0, 0, 3, - 2, 0, 4, 5, 0, 6, 7, 6, - 8, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 9, 0, 10, 0, 11, 0, 0, 0, - 11, 0, 0, 12, 0, 0, 0, 0, - 11, 0, 11, 0, 13, 14, 15, 16, - 17, 18, 19, 20, 0, 0, 21, 0, - 0, 0, 22, 0, 23, 23, 23, 24, - 23, 0, 0, 0, 0, 0, 25, 25, - 26, 25, 23, 27, 28, 29, 30, 31, - 32, 33, 31, 34, 0, 0, 35, 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, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0 + -5, -13, -13, -15, -6, -7, -7, -7, + -7, -2, -2, -8, -2, -7, -10, 1, + -13, -13, -15, -6, -7, -7, -7, -7, + -2, -2, -8, -2, -7, -10, 1, 3, + 2, 3, -21, -21, -21, -21, -28, -15, + -15, -8, -1, -1, -1, -1, -16, -2, + -11, -9, -12, -1, -2, -1, -6, -4, + -6, 2, -3, -3, -7, -3, -4, -1, + -2, -13, -13, -3, -3, -3, -3, -5, + -3, 3, -2, -2, -2, -2, -2, -2, + -2, -2, -3, -3, -3, -29, -29, -21, + -33, 3, -4, -3, -3, -3, -3, -3, + -3, -3, -3, -3, -3, 2, -4, 2, + -3, 2, -4, 2, -3, -3, -8, -4, + -4, -4, -4, -3, -3, -3, -3, -3, + -3, -3, -3, -3, -3, -5, -8, -5, + -42, -42, 2, -8, -8, -8, -8, -34, + -7, -22, -18, -30, -5, -17, -11, -17, + 2, -4, 2, -3, 2, -4, 2, -3, + -13, -13, -3, -3, -3, -3, -5, -3, + -40, -40, -17, -25, -4, -3, -1, -2, + -2, -2, -2, -2, -2, 2, 2, 2, + -5, -3, -2, -4, -10, -2, -6, -5, + -27, -29, -27, -10, -3, -3, -30, -3, + -3, -2, 2, 2, 2, 2, -14, -12, + -12, -12, -12, -14, -14, -12, -14, -12, + -9, -14, -12, -9, -7, -10, -9, -7, + -3, 3, -28, -5, -28, -9, -2, -2, + -2, -2, 2, -6, -5, -5, -5, -5, + -6, -5, -4, -3, -1, -1, 2, 2, + -15, -7, -15, -5, 2, 2, -4, -4, + -4, -4, -4, -4, -4, -3, -2, 2, + -6, -3, -3, -3, -3, 2, -3, -3, + -3, -3, -3, -3, -3, -4, -4, -4, + 3, -6, -26, -6, -26, -12, -4, -4, + -12, -4, -4, -2, 2, -12, 2, 2, + 2, 2, 2, -9, -8, -8, -8, -3, + -8, -5, -5, -8, -5, -8, -5, -7, + -3, -5, -2, -3, -2, -4, 2, -6, + 2, -3, -3, -3, -3, -3, -3, -3, + -3, -3, -3, -2, -3, -3, -3, -2, + -2, -8, -8, -2, -2, -4, -4, -1, + -2, -1, -2, -1, -1, -2, -2, -2, + -2, 2, 2, 3, 2, -3, -3, -3, + -3, -3, 2, -13, -13, -2, -2, -2, + -2, -2, -13, -13, -13, -13, -17, -17, + -2, -3, -2, -2, -4, -4, -1, -2, + -1, -2, 2, 2, -15, -15, -5, -2, + -2, -2, 2, -2, -2, -2, 6, 2, + 2, 2, -2, 2, 2, -13, -13, -2, + -2, -2, -2, 2, -2, -2, -2, -15, + -15, -2, -2, -2, -2, -2, -2, 2, + 2, -13, -13, -2, -2, -2, -2, 2, + -2, -2, -2, -2, -2, -2, -2, -2, + -2, -2, -2 }; -/*Kern values between classes*/ -static const int8_t kern_class_values[] = +/*Collect the kern pair's data in one place*/ +static const lv_font_fmt_txt_kern_pair_t kern_pairs = { - 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, 0, 0, 0, -13, 0, 0, 0, - 0, 0, 0, 0, -15, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -6, -7, 0, -2, -8, 0, -10, 0, - 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 3, 2, 0, - 3, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, -21, 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, - 0, 0, 0, -28, 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, - -15, 0, 0, 0, 0, 0, 0, -8, - 0, -1, 0, 0, -16, -2, -11, -9, - 0, -12, 0, 0, 0, 0, 0, 0, - -1, 0, 0, -2, -1, -6, -4, 0, - 2, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, -3, - 0, -3, 0, 0, -7, 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, -4, 0, 0, 0, 0, 0, - 0, -1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, -2, - 0, 0, 0, 0, 0, -13, 0, 0, - 0, -3, 0, 0, 0, -3, 0, -3, - 0, -3, -5, -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, - 3, 0, 0, 0, 0, 0, 0, 0, - 0, -2, -2, 0, -2, 0, 0, 0, - -2, -3, -3, 0, 0, 0, 0, 0, - 0, 0, 0, -29, 0, 0, 0, -21, - 0, -33, 0, 3, 0, 0, 0, 0, - 0, 0, 0, -4, -3, 0, 0, -3, - -3, 0, 0, -3, -3, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 2, 0, 0, 0, -4, 0, - 0, 0, 2, -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, -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, -8, 0, 0, - 0, -4, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, -3, 0, -3, - -3, 0, 0, 0, -3, -5, -8, 0, - 0, 0, 0, -42, 0, 0, 0, 0, - 0, 0, 0, 2, -8, 0, 0, -34, - -7, -22, -18, 0, -30, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, -5, - -17, -11, 0, 0, 0, 0, 0, 0, - 0, 0, -40, 0, 0, 0, -17, 0, - -25, 0, 0, 0, 0, 0, -4, 0, - -3, 0, -1, -2, 0, 0, -2, 0, - 0, 2, 0, 2, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, -5, 0, -3, - -2, 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, - -10, 0, -2, 0, 0, -6, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, -5, 0, - 0, 0, 0, -27, -29, 0, 0, -10, - -3, -30, -2, 2, 0, 2, 2, 0, - 2, 0, 0, -14, -12, 0, -14, -12, - -9, -14, 0, -12, -9, -7, -10, -7, - 0, 0, 0, 0, 3, 0, -28, -5, - 0, 0, -9, -2, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 2, -6, -5, - 0, 0, -6, -4, 0, 0, -3, -1, - 0, 0, 0, 2, 0, 0, 0, 2, - 0, -15, -7, 0, 0, -5, 0, 0, - 0, 2, 0, 0, 0, 0, 0, 0, - 2, -4, -4, 0, 0, -4, -3, 0, - 0, -2, 0, 0, 0, 0, 2, 0, - 0, 0, 0, 0, 0, -6, 0, 0, - 0, -3, 0, 0, 0, 0, 2, 0, - 0, 0, 0, 0, 0, -3, 0, 0, - -3, 0, 0, 0, -3, -4, 0, 0, - 0, 0, 0, 0, -4, 3, -6, -26, - -6, 0, 0, -12, -4, -12, -2, 2, - -12, 2, 2, 2, 2, 0, 2, -9, - -8, -3, -5, -8, -5, -7, -3, -5, - -2, 0, -3, -4, 2, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 2, -3, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, -3, 0, 0, -3, 0, - 0, 0, -2, -3, -3, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, -2, 0, 0, -2, 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, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, -2, 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, -1, 0, -2, -2, - 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, 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, -2, 0, 0, 0, 0, 0, - 2, 0, 3, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 2, 0, -3, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 2, 0, -13, 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, 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, -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, 0, 0, 0, 0, -2, 0, - -3, -2, 0, 0, 2, 0, 0, 0, - -15, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -5, -2, 2, 0, -2, 0, 0, 6, - 0, 2, 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, -2, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 2, 0, 0, 0, -13, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, -2, -2, - 2, 0, -2, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, -15, 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, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, -2, 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, 0, 0, 0, - -2, 0, 0, -2, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - -2, 0, 0, -2, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 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 = 35, + .glyph_ids = kern_pair_glyph_ids, + .values = kern_pair_values, + .pair_cnt = 435, + .glyph_ids_size = 0 }; /*-------------------- @@ -2089,11 +2362,11 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .glyph_bitmap = gylph_bitmap, .glyph_dsc = glyph_dsc, .cmaps = cmaps, - .kern_dsc = &kern_classes, + .kern_dsc = &kern_pairs, .kern_scale = 16, .cmap_num = 2, .bpp = 4, - .kern_classes = 1, + .kern_classes = 0, .bitmap_format = 0 }; @@ -2108,9 +2381,10 @@ lv_font_t lv_font_roboto_16 = { .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 .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ }; #endif /*#if LV_FONT_ROBOTO_16*/ - diff --git a/src/lv_widgets/lv_textarea.c b/src/lv_widgets/lv_textarea.c index 95890c342c..4c910da101 100644 --- a/src/lv_widgets/lv_textarea.c +++ b/src/lv_widgets/lv_textarea.c @@ -36,6 +36,9 @@ #define LV_TEXTAREA_DEF_WIDTH (2 * LV_DPI) #define LV_TEXTAREA_DEF_HEIGHT (1 * LV_DPI) +#define LV_TEXTAREA_PWD_BULLET_UNICODE 0x2022 +#define LV_TEXTAREA_PWD_BULLET_UTF8 "\xE2\x80\xA2" + /********************** * TYPEDEFS **********************/ @@ -699,16 +702,9 @@ void lv_textarea_set_pwd_mode(lv_obj_t * ta, bool en) strcpy(ext->pwd_tmp, txt); - uint16_t i; - uint16_t encoded_len = lv_txt_get_encoded_length(txt); - for(i = 0; i < encoded_len; i++) { - txt[i] = '*'; /*All char to '*'*/ - } - txt[i] = '\0'; + pwd_char_hider(ta); lv_textarea_clear_selection(ta); - - lv_label_set_text(ext->label, NULL); } /*Pwd mode is now disabled*/ else if(ext->pwd_mode == 1 && en == false) { @@ -1634,17 +1630,29 @@ static void pwd_char_hider(lv_obj_t * ta) lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); if(ext->pwd_mode != 0) { char * txt = lv_label_get_text(ext->label); - int16_t len = lv_txt_get_encoded_length(txt); - bool refr = false; + int16_t enc_len = lv_txt_get_encoded_length(txt); + if(enc_len == 0) return; + + /*If the textarea's font has "bullet" character use it else fallback to "*"*/ + const lv_font_t * font = lv_obj_get_style_text_font(ta, LV_TEXTAREA_PART_BG); + lv_font_glyph_dsc_t g; + bool has_bullet; + has_bullet = lv_font_get_glyph_dsc(font, &g, LV_TEXTAREA_PWD_BULLET_UNICODE, 0); + const char * bullet; + if(has_bullet) bullet = LV_TEXTAREA_PWD_BULLET_UTF8; + else bullet = "*"; + + size_t bullet_len = strlen(bullet); + char * txt_tmp = lv_mem_buf_get(enc_len * bullet_len + 1); uint16_t i; - for(i = 0; i < len; i++) { - txt[i] = '*'; - refr = true; + for(i = 0; i < enc_len; i++) { + memcpy(&txt_tmp[i * bullet_len], bullet, bullet_len); } - txt[i] = '\0'; + txt_tmp[i * bullet_len] = '\0'; - if(refr != false) lv_label_set_text(ext->label, txt); + lv_label_set_text(ext->label, txt_tmp); + lv_mem_buf_release(txt_tmp); } }