mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-18 10:53:17 +00:00
**New Features** * Runtime font accessors and new symbol fonts for text, launcher, statusbar, and shared icons. * Added font height base setting to device.properties * Text fonts now have 3 sizes: small, default, large **Improvements** * Renamed `UiScale` to `UiDensity` * Statusbar, toolbar and many UI components now compute heights and spacing from fonts/density. * SSD1306 initialization sequence refined for more stable startup. * Multiple image assets replaced by symbol-font rendering. * Many layout improvements related to density, font scaling and icon scaling * Updated folder name capitalization for newer style
247 lines
8.3 KiB
C
247 lines
8.3 KiB
C
/*******************************************************************************
|
|
* Size: 12 px
|
|
* Bpp: 2
|
|
* Opts: --no-compress --no-prefilter --bpp 2 --size 12 --font MaterialSymbolsRounded.ttf -r 0xF1DB,0xF15C,0xE322,0xE623,0xF057,0xF0B0,0xEBE4,0xEBD6,0xEBE1,0xF065,0xE1DA,0xF064,0xF257,0xF256,0xF255,0xF254,0xF253,0xF252,0xF24F,0xF250 --format lvgl -o ../source-fonts/material_symbols_statusbar_12.c --force-fast-kern-format
|
|
******************************************************************************/
|
|
|
|
#ifdef LV_LVGL_H_INCLUDE_SIMPLE
|
|
#include "lvgl.h"
|
|
#else
|
|
#include "lvgl/lvgl.h"
|
|
#endif
|
|
|
|
#ifndef MATERIAL_SYMBOLS_STATUSBAR_12
|
|
#define MATERIAL_SYMBOLS_STATUSBAR_12 1
|
|
#endif
|
|
|
|
#if MATERIAL_SYMBOLS_STATUSBAR_12
|
|
|
|
/*-----------------
|
|
* BITMAPS
|
|
*----------------*/
|
|
|
|
/*Store the image of the glyphs*/
|
|
static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = {
|
|
/* U+E1DA "" */
|
|
0x50, 0x0, 0x0, 0x38, 0xff, 0x80, 0x2e, 0x0,
|
|
0x78, 0xa3, 0x80, 0xe, 0x34, 0xe0, 0x1c, 0xd,
|
|
0x38, 0x70, 0x3, 0x4e, 0x0, 0x0, 0xd7, 0x80,
|
|
0x0, 0x3c, 0xe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0xf4, 0xaf, 0xf0, 0xb4, 0x96, 0x40, 0x20, 0x7f,
|
|
0xfd, 0x0,
|
|
|
|
/* U+F252 "" */
|
|
0x7f, 0xff, 0xe0, 0x96, 0xa9, 0x30, 0xaf, 0xff,
|
|
0x39, 0xaf, 0xff, 0x39, 0x96, 0xa9, 0x30, 0x7f,
|
|
0xff, 0xe0,
|
|
|
|
/* U+F253 "" */
|
|
0x7f, 0xff, 0xe0, 0x96, 0xa4, 0x30, 0xaf, 0xfc,
|
|
0x39, 0xaf, 0xfc, 0x39, 0x96, 0xa4, 0x30, 0x7f,
|
|
0xff, 0xe0,
|
|
|
|
/* U+F254 "" */
|
|
0x7f, 0xff, 0xe0, 0x96, 0x90, 0x30, 0xaf, 0xf0,
|
|
0x39, 0xaf, 0xf0, 0x39, 0x96, 0x90, 0x30, 0x7f,
|
|
0xff, 0xe0,
|
|
|
|
/* U+F255 "" */
|
|
0x7f, 0xff, 0xe0, 0x96, 0x40, 0x30, 0xaf, 0xc0,
|
|
0x39, 0xaf, 0xc0, 0x39, 0x96, 0x40, 0x30, 0x7f,
|
|
0xff, 0xe0,
|
|
|
|
/* U+F256 "" */
|
|
0x7f, 0xff, 0xe0, 0x95, 0x0, 0x30, 0xaf, 0x0,
|
|
0x39, 0xaf, 0x0, 0x39, 0x95, 0x0, 0x30, 0x7f,
|
|
0xff, 0xe0,
|
|
|
|
/* U+F257 "" */
|
|
0x7f, 0xff, 0xe0, 0x94, 0x0, 0x30, 0xac, 0x0,
|
|
0x39, 0xac, 0x0, 0x39, 0x94, 0x0, 0x30, 0x7f,
|
|
0xff, 0xe0
|
|
};
|
|
|
|
|
|
/*---------------------
|
|
* 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 = 192, .box_w = 12, .box_h = 11, .ofs_x = 0, .ofs_y = 0},
|
|
{.bitmap_index = 33, .adv_w = 192, .box_w = 10, .box_h = 10, .ofs_x = 1, .ofs_y = 1},
|
|
{.bitmap_index = 58, .adv_w = 192, .box_w = 8, .box_h = 10, .ofs_x = 2, .ofs_y = 1},
|
|
{.bitmap_index = 78, .adv_w = 192, .box_w = 12, .box_h = 9, .ofs_x = 0, .ofs_y = 1},
|
|
{.bitmap_index = 105, .adv_w = 192, .box_w = 12, .box_h = 9, .ofs_x = 0, .ofs_y = 1},
|
|
{.bitmap_index = 132, .adv_w = 192, .box_w = 12, .box_h = 9, .ofs_x = 0, .ofs_y = 1},
|
|
{.bitmap_index = 159, .adv_w = 192, .box_w = 8, .box_h = 10, .ofs_x = 2, .ofs_y = 1},
|
|
{.bitmap_index = 179, .adv_w = 192, .box_w = 12, .box_h = 9, .ofs_x = 0, .ofs_y = 1},
|
|
{.bitmap_index = 206, .adv_w = 192, .box_w = 12, .box_h = 9, .ofs_x = 0, .ofs_y = 1},
|
|
{.bitmap_index = 233, .adv_w = 192, .box_w = 12, .box_h = 9, .ofs_x = 0, .ofs_y = 1},
|
|
{.bitmap_index = 260, .adv_w = 192, .box_w = 12, .box_h = 8, .ofs_x = 0, .ofs_y = 2},
|
|
{.bitmap_index = 284, .adv_w = 192, .box_w = 8, .box_h = 10, .ofs_x = 2, .ofs_y = 1},
|
|
{.bitmap_index = 304, .adv_w = 192, .box_w = 12, .box_h = 6, .ofs_x = 0, .ofs_y = 3},
|
|
{.bitmap_index = 322, .adv_w = 192, .box_w = 12, .box_h = 6, .ofs_x = 0, .ofs_y = 3},
|
|
{.bitmap_index = 340, .adv_w = 192, .box_w = 12, .box_h = 6, .ofs_x = 0, .ofs_y = 3},
|
|
{.bitmap_index = 358, .adv_w = 192, .box_w = 12, .box_h = 6, .ofs_x = 0, .ofs_y = 3},
|
|
{.bitmap_index = 376, .adv_w = 192, .box_w = 12, .box_h = 6, .ofs_x = 0, .ofs_y = 3},
|
|
{.bitmap_index = 394, .adv_w = 192, .box_w = 12, .box_h = 6, .ofs_x = 0, .ofs_y = 3},
|
|
{.bitmap_index = 412, .adv_w = 192, .box_w = 12, .box_h = 6, .ofs_x = 0, .ofs_y = 3},
|
|
{.bitmap_index = 430, .adv_w = 192, .box_w = 12, .box_h = 6, .ofs_x = 0, .ofs_y = 3}
|
|
};
|
|
|
|
/*---------------------
|
|
* CHARACTER MAPPING
|
|
*--------------------*/
|
|
|
|
static const uint16_t unicode_list_0[] = {
|
|
0x0, 0x148, 0x449, 0x9fc, 0xa07, 0xa0a, 0xe7d, 0xe8a,
|
|
0xe8b, 0xed6, 0xf82, 0x1001, 0x1075, 0x1076, 0x1078, 0x1079,
|
|
0x107a, 0x107b, 0x107c, 0x107d
|
|
};
|
|
|
|
/*Collect the unicode lists and glyph_id offsets*/
|
|
static const lv_font_fmt_txt_cmap_t cmaps[] =
|
|
{
|
|
{
|
|
.range_start = 57818, .range_length = 4222, .glyph_id_start = 1,
|
|
.unicode_list = unicode_list_0, .glyph_id_ofs_list = NULL, .list_length = 20, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_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 = 2,
|
|
.kern_classes = 0,
|
|
.bitmap_format = 0,
|
|
#if LVGL_VERSION_MAJOR == 8
|
|
.cache = &cache
|
|
#endif
|
|
};
|
|
|
|
|
|
|
|
/*-----------------
|
|
* PUBLIC FONT
|
|
*----------------*/
|
|
|
|
/*Initialize a public general font descriptor*/
|
|
#if LVGL_VERSION_MAJOR >= 8
|
|
const lv_font_t material_symbols_statusbar_12 = {
|
|
#else
|
|
lv_font_t material_symbols_statusbar_12 = {
|
|
#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 = 11, /*The maximum line height required by the font*/
|
|
.base_line = 0, /*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 = 0,
|
|
.underline_thickness = 0,
|
|
#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 = NULL,
|
|
#endif
|
|
.user_data = NULL,
|
|
};
|
|
|
|
|
|
|
|
#endif /*#if MATERIAL_SYMBOLS_STATUSBAR_12*/
|
|
|