#include "lvgl/lvgl.h" /******************************************************************************* * Size: 20 px * Bpp: 1 * Opts: ******************************************************************************/ #ifndef CUSTOMICONS #define CUSTOMICONS 1 #endif #if CUSTOMICONS /*----------------- * BITMAPS *----------------*/ /*Store the image of the glyphs*/ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { /* U+F002 "" */ 0x1, 0x80, 0x1, 0xfe, 0x0, 0xff, 0xe0, 0x1e, 0x3e, 0x7, 0x81, 0xe1, 0xe0, 0x1c, 0x38, 0x3, 0xc7, 0x0, 0x38, 0xe0, 0x7, 0x1c, 0x0, 0xe3, 0xc0, 0x38, 0x38, 0xf, 0x7, 0x83, 0xc0, 0x7f, 0xfc, 0x7, 0xff, 0xc0, 0x3f, 0x3c, 0x0, 0x3, 0xc0, 0x0, 0x3c, 0x0, 0x3, 0x0, /* U+F0E4 "" */ 0x0, 0x0, 0x0, 0x3f, 0xc0, 0xf, 0x9f, 0x1, 0xf9, 0xf8, 0x33, 0x9c, 0xc7, 0x3f, 0xce, 0x73, 0xec, 0xe7, 0xfe, 0xfe, 0xff, 0xcf, 0xfd, 0xfc, 0xfb, 0xcf, 0xdf, 0x3c, 0xf0, 0xf3, 0xff, 0xf, 0xff, 0xf0, 0xff, 0x7f, 0x9f, 0xe7, 0xff, 0xfe, 0x3f, 0xff, 0xc0, /* U+F187 "" */ 0x7f, 0xff, 0xe7, 0xff, 0xfe, 0x7f, 0xff, 0xe7, 0xff, 0xfe, 0x7f, 0xff, 0xe3, 0xff, 0xfc, 0x7f, 0xff, 0xe7, 0xff, 0xfe, 0x7f, 0xf, 0xe7, 0xff, 0xfe, 0x7f, 0xff, 0xe7, 0xff, 0xfe, 0x7f, 0xff, 0xe7, 0xff, 0xfe, 0x7f, 0xff, 0xe7, 0xff, 0xfe, 0x7f, 0xff, 0xe3, 0xff, 0xfc }; /*--------------------- * GLYPH DESCRIPTION *--------------------*/ static const 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 = 297, .box_h = 19, .box_w = 19, .ofs_x = 0, .ofs_y = -3}, {.bitmap_index = 46, .adv_w = 320, .box_h = 17, .box_w = 20, .ofs_x = 0, .ofs_y = -2}, {.bitmap_index = 89, .adv_w = 320, .box_h = 18, .box_w = 20, .ofs_x = 0, .ofs_y = -2} }; /*--------------------- * CHARACTER MAPPING *--------------------*/ static const uint16_t unicode_list_0[] = { 0x0, 0xe2, 0x185 }; /*Collect the unicode lists and glyph_id offsets*/ static const lv_font_fmt_txt_cmap_t cmaps[] = { { .range_start = 61442, .range_length = 390, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY, .glyph_id_start = 1, .unicode_list = unicode_list_0, .glyph_id_ofs_list = NULL, .list_length = 3 } }; /*-------------------- * ALL CUSTOM DATA *--------------------*/ /*Store all the custom data of the font*/ static lv_font_fmt_txt_dsc_t font_dsc = { .glyph_bitmap = gylph_bitmap, .glyph_dsc = glyph_dsc, .cmaps = cmaps, .cmap_num = 1, .bpp = 1, .kern_scale = 0, .kern_dsc = NULL, .kern_classes = 0, }; /*----------------- * PUBLIC FONT *----------------*/ /*Initialize a public general font descriptor*/ lv_font_t CustomIcons = { .dsc = &font_dsc, /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ .get_glyph_bitmap = lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/ .get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/ .line_height = 19, /*The maximum line height required by the font*/ .base_line = 3, /*Baseline measured from the bottom of the line*/ }; #endif /*#if CUSTOMICONS*/