/******************************************************************************* * Size: 32 px * Bpp: 4 * Opts: --bpp 4 --size 32 --no-compress --font FontAwesome5-Solid+Brands+Regular.woff --range 63372 --format lvgl -o myfontawesome.c ******************************************************************************/ #ifdef LV_LVGL_H_INCLUDE_SIMPLE #include "lvgl.h" #else #include "../../lvgl.h" #endif #ifndef MYFONTAWESOME #define MYFONTAWESOME 1 #endif #if MYFONTAWESOME /*----------------- * BITMAPS *----------------*/ /*Store the image of the glyphs*/ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { /* U+F78C "" */ 0x5, 0xe7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7e, 0x50, 0x5f, 0xff, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7, 0xff, 0xf5, 0xef, 0xff, 0xf8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7f, 0xff, 0xfe, 0x7f, 0xff, 0xff, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7, 0xff, 0xff, 0xf7, 0x8, 0xff, 0xff, 0xf8, 0x0, 0x9, 0xf7, 0x0, 0x0, 0x8f, 0x90, 0x0, 0x7f, 0xff, 0xff, 0x70, 0x0, 0x8f, 0xff, 0xff, 0x80, 0x8f, 0xff, 0x0, 0x0, 0xff, 0xf8, 0x7, 0xff, 0xff, 0xf7, 0x0, 0x0, 0x8, 0xff, 0xff, 0xfc, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0xcf, 0xff, 0xff, 0x70, 0x0, 0x0, 0x0, 0x8f, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0xff, 0xff, 0xf7, 0x0, 0x0, 0x0, 0x0, 0x8, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0xff, 0xff, 0x70, 0x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0, 0xff, 0xff, 0xff, 0xff, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0xcf, 0xff, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0xff, 0xfc, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0xff, 0xff, 0x80, 0x0, 0x0, 0x0, 0x0, 0x7f, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x0, 0x0, 0x0, 0x7, 0xff, 0xff, 0xfc, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0xcf, 0xff, 0xff, 0x80, 0x0, 0x0, 0x7f, 0xff, 0xff, 0x70, 0x9f, 0xff, 0x0, 0x0, 0xff, 0xf8, 0x8, 0xff, 0xff, 0xf8, 0x0, 0x7, 0xff, 0xff, 0xf7, 0x0, 0x9, 0xf7, 0x0, 0x0, 0x8f, 0x90, 0x0, 0x8f, 0xff, 0xff, 0x80, 0x7f, 0xff, 0xff, 0x70, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8, 0xff, 0xff, 0xf7, 0xef, 0xff, 0xf7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8f, 0xff, 0xfe, 0x5f, 0xff, 0x70, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8, 0xff, 0xf5, 0x5, 0xe7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7f, 0x50, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }; /*--------------------- * GLYPH DESCRIPTION *--------------------*/ static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { {.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */, {.bitmap_index = 0, .adv_w = 512, .box_w = 32, .box_h = 33, .ofs_x = 0, .ofs_y = -5} }; /*--------------------- * CHARACTER MAPPING *--------------------*/ /*Collect the unicode lists and glyph_id offsets*/ static const lv_font_fmt_txt_cmap_t cmaps[] = { { .range_start = 63372, .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 } }; /*-------------------- * 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 = glyph_bitmap, .glyph_dsc = glyph_dsc, .cmaps = cmaps, .kern_dsc = NULL, .kern_scale = 0, .cmap_num = 1, .bpp = 4, .kern_classes = 0, .bitmap_format = 0, #if LVGL_VERSION_MAJOR == 8 .cache = &cache #endif }; extern const lv_font_t lv_font_montserrat_24; /*----------------- * PUBLIC FONT *----------------*/ /*Initialize a public general font descriptor*/ #if LVGL_VERSION_MAJOR >= 8 const lv_font_t myfontawesome = { #else lv_font_t myfontawesome = { #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 = 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 = -11, .underline_thickness = 2, #endif .dsc = &font_dsc, /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ #if LV_VERSION_CHECK(8, 2, 0) || LVGL_VERSION_MAJOR >= 9 .fallback = &lv_font_montserrat_24, #endif .user_data = NULL, }; #endif /*#if MYFONTAWESOME*/