mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-18 19:03:16 +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
221 lines
7.8 KiB
C
221 lines
7.8 KiB
C
/*******************************************************************************
|
|
* Size: 42 px
|
|
* Bpp: 2
|
|
* Opts: --no-compress --no-prefilter --bpp 2 --size 42 --font MaterialSymbolsRounded.ttf -r 0xE5C3,0xE2C7,0xE8B8 --format lvgl -o ../source-fonts/material_symbols_launcher_42.c --force-fast-kern-format
|
|
******************************************************************************/
|
|
|
|
#ifdef LV_LVGL_H_INCLUDE_SIMPLE
|
|
#include "lvgl.h"
|
|
#else
|
|
#include "lvgl/lvgl.h"
|
|
#endif
|
|
|
|
#ifndef MATERIAL_SYMBOLS_LAUNCHER_42
|
|
#define MATERIAL_SYMBOLS_LAUNCHER_42 1
|
|
#endif
|
|
|
|
#if MATERIAL_SYMBOLS_LAUNCHER_42
|
|
|
|
/*-----------------
|
|
* BITMAPS
|
|
*----------------*/
|
|
|
|
/*Store the image of the glyphs*/
|
|
static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = {
|
|
/* U+E2C7 "" */
|
|
0xb, 0xff, 0xff, 0xf8, 0x0, 0x0, 0x0, 0x0,
|
|
0x0, 0x3f, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0,
|
|
0x0, 0x0, 0x7f, 0xff, 0xff, 0xff, 0xc0, 0x0,
|
|
0x0, 0x0, 0x0, 0x7f, 0xaa, 0xaa, 0xbf, 0xfa,
|
|
0xaa, 0xaa, 0xaa, 0x40, 0xbf, 0x0, 0x0, 0xf,
|
|
0xff, 0xff, 0x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0x0, 0x0, 0x0, 0x0, 0x7f, 0xff, 0xd0, 0x0,
|
|
0x0, 0x0, 0x0, 0x0, 0x0, 0x6a, 0x90, 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 = 672, .box_w = 36, .box_h = 28, .ofs_x = 3, .ofs_y = 7},
|
|
{.bitmap_index = 252, .adv_w = 672, .box_w = 28, .box_h = 28, .ofs_x = 7, .ofs_y = 7},
|
|
{.bitmap_index = 448, .adv_w = 672, .box_w = 34, .box_h = 36, .ofs_x = 4, .ofs_y = 3}
|
|
};
|
|
|
|
/*---------------------
|
|
* CHARACTER MAPPING
|
|
*--------------------*/
|
|
|
|
static const uint16_t unicode_list_0[] = {
|
|
0x0, 0x2fc, 0x5f1
|
|
};
|
|
|
|
/*Collect the unicode lists and glyph_id offsets*/
|
|
static const lv_font_fmt_txt_cmap_t cmaps[] =
|
|
{
|
|
{
|
|
.range_start = 58055, .range_length = 1522, .glyph_id_start = 1,
|
|
.unicode_list = unicode_list_0, .glyph_id_ofs_list = NULL, .list_length = 3, .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_launcher_42 = {
|
|
#else
|
|
lv_font_t material_symbols_launcher_42 = {
|
|
#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 = 36, /*The maximum line height required by the font*/
|
|
.base_line = -3, /*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_LAUNCHER_42*/
|
|
|