Add theme switching
This commit is contained in:
parent
14de16a506
commit
58e8618268
3 changed files with 173 additions and 59 deletions
|
|
@ -22,6 +22,7 @@ The biggest obstacle is input processing. [lv_drivers] provides an evdev interfa
|
|||
- Works great on my laptop keyboard but occasionally drops keys on my Ergodox EZ)
|
||||
- On-screen keyboard control via touchscreen (tested on PinePhone)
|
||||
- Switching on-screen keyboard layout at runtime (layouts still to be refined, currently only supports US English and German)
|
||||
- Switching between light and dark theme at runtime
|
||||
|
||||
## To do
|
||||
|
||||
|
|
@ -66,6 +67,8 @@ Fonts need to be converted to C arrays before they can be used with [lvgl]. This
|
|||
0xF001, 0xF008, 0xF00B, 0xF00C, 0xF00D, 0xF011, 0xF013, 0xF015, 0xF019, 0xF01C, 0xF021, 0xF026, 0xF027, 0xF028, 0xF03E, 0xF0E0, 0xF304, 0xF043, 0xF048, 0xF04B, 0xF04C, 0xF04D, 0xF051, 0xF052, 0xF053, 0xF054, 0xF067, 0xF068, 0xF06E, 0xF070, 0xF071, 0xF074, 0xF077, 0xF078, 0xF079, 0xF07B, 0xF093, 0xF095, 0xF0C4, 0xF0C5, 0xF0C7, 0xF0C9, 0xF0E7, 0xF0EA, 0xF0F3, 0xF11C, 0xF124, 0xF158, 0xF1EB, 0xF240, 0xF241, 0xF242, 0xF243, 0xF244, 0xF287, 0xF293, 0xF2ED, 0xF55A, 0xF7C2, 0xF8A2
|
||||
```
|
||||
|
||||
as well as `0xF042` for the [adjust] icon.
|
||||
|
||||
# Acknowledgements
|
||||
|
||||
The [lv_port_linux_frame_buffer] project served as a starting point for the codebase. The mouse cursor image was taken from [lv_sim_emscripten].
|
||||
|
|
@ -82,6 +85,7 @@ Unl0kr is licensed under the GNU General Public License as published by the Free
|
|||
[libxkbcommon]: https://github.com/xkbcommon/libxkbcommon
|
||||
[online font converter]: https://lvgl.io/tools/fontconverter
|
||||
[Font Awesome]: https://lvgl.io/assets/others/FontAwesome5-Solid+Brands+Regular.woff
|
||||
[adjust]: https://fontawesome.com/v5.15/icons/adjust?style=solid
|
||||
[Add support for pointer devices to libinput driver]: https://github.com/lvgl/lv_drivers/pull/150
|
||||
[Add support for keypads to libinput driver]: https://github.com/lvgl/lv_drivers/pull/152
|
||||
[Don't compile example assets when disabled in lv_conf.h]: https://github.com/lvgl/lvgl/pull/2523
|
||||
|
|
|
|||
51
main.c
51
main.c
|
|
@ -11,6 +11,14 @@
|
|||
#include "libinput_xkb.h"
|
||||
#include "layouts.h"
|
||||
|
||||
// Custom fonts
|
||||
|
||||
LV_FONT_DECLARE(montserrat_extended_32);
|
||||
|
||||
// Custom symbols
|
||||
|
||||
#define SYMBOL_ADJUST "\xef\x81\x82" // 0xF042 https://fontawesome.com/v5.15/icons/adjust?style=solid
|
||||
|
||||
// Mouse cursor image (from https://github.com/lvgl/lv_sim_emscripten/blob/master/mouse_cursor_icon.c)
|
||||
|
||||
const uint8_t mouse_cursor_icon_map[] = {
|
||||
|
|
@ -116,10 +124,20 @@ lv_img_dsc_t mouse_cursor_icon = {
|
|||
.data = mouse_cursor_icon_map,
|
||||
};
|
||||
|
||||
// Global widgets
|
||||
// Global variables
|
||||
|
||||
bool is_dark_theme = false;
|
||||
lv_obj_t *keyboard = NULL;
|
||||
|
||||
// Theming
|
||||
|
||||
void set_theme(bool is_dark);
|
||||
|
||||
void set_theme(bool is_dark) {
|
||||
lv_theme_default_init(
|
||||
NULL, lv_palette_main(LV_PALETTE_BLUE), lv_palette_main(LV_PALETTE_CYAN), is_dark, &montserrat_extended_32);
|
||||
}
|
||||
|
||||
// Event callbacks
|
||||
|
||||
void keyboard_event_ready_cb(lv_event_t *e);
|
||||
|
|
@ -137,7 +155,18 @@ void keyboard_event_cancel_cb(lv_event_t *e) {
|
|||
abort();
|
||||
}
|
||||
|
||||
void keymap_dropdown_event_cb(lv_event_t * e) {
|
||||
void theme_switcher_event_cb(lv_event_t *e);
|
||||
|
||||
void theme_switcher_event_cb(lv_event_t *e) {
|
||||
if(lv_event_get_code(e) == LV_EVENT_VALUE_CHANGED) {
|
||||
is_dark_theme = !is_dark_theme;
|
||||
set_theme(is_dark_theme);
|
||||
}
|
||||
}
|
||||
|
||||
void keymap_dropdown_event_cb(lv_event_t *e);
|
||||
|
||||
void keymap_dropdown_event_cb(lv_event_t *e) {
|
||||
if(lv_event_get_code(e) != LV_EVENT_VALUE_CHANGED) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -232,8 +261,8 @@ int main(void)
|
|||
|
||||
// Build the UI...
|
||||
|
||||
// Register fonts
|
||||
LV_FONT_DECLARE(montserrat_extended_32);
|
||||
// Initialise theme
|
||||
set_theme(is_dark_theme);
|
||||
|
||||
// Figure out a few numbers for sizing and positioning
|
||||
int row_height = ver_res / 6;
|
||||
|
|
@ -294,6 +323,20 @@ int main(void)
|
|||
lv_obj_add_event_cb(keyboard, keyboard_event_cancel_cb, LV_EVENT_CANCEL, NULL);
|
||||
lv_obj_add_event_cb(keyboard, keyboard_event_ready_cb, LV_EVENT_READY, NULL);
|
||||
|
||||
// Theme switcher
|
||||
lv_obj_t *theme_switcher = lv_btn_create(lv_scr_act());
|
||||
lv_obj_align(theme_switcher, LV_ALIGN_TOP_LEFT, 20, 20);
|
||||
lv_obj_add_flag(theme_switcher, LV_OBJ_FLAG_CHECKABLE);
|
||||
lv_obj_set_height(theme_switcher, LV_SIZE_CONTENT);
|
||||
lv_obj_t *theme_switcher_label = lv_label_create(theme_switcher);
|
||||
lv_style_t style_theme_switcher_label;
|
||||
lv_style_init(&style_theme_switcher_label);
|
||||
lv_style_set_text_font(&style_theme_switcher_label, &montserrat_extended_32);
|
||||
lv_obj_add_style(theme_switcher_label, &style_theme_switcher_label, 0);
|
||||
lv_obj_center(theme_switcher_label);
|
||||
lv_label_set_text(theme_switcher_label, SYMBOL_ADJUST);
|
||||
lv_obj_add_event_cb(theme_switcher, theme_switcher_event_cb, LV_EVENT_ALL, NULL);
|
||||
|
||||
// Keymap dropdown
|
||||
lv_obj_t *dropdown = lv_dropdown_create(lv_scr_act());
|
||||
lv_dropdown_set_options(dropdown, get_layout_names());
|
||||
|
|
|
|||
|
|
@ -5637,6 +5637,72 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = {
|
|||
0x8, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x80,
|
||||
|
||||
/* U+F042 "" */
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x34,
|
||||
0x43, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x5a, 0xef, 0xff,
|
||||
0xff, 0xfd, 0x94, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x6e, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xc4, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x2c, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xa0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x3, 0xef, 0xff, 0xff, 0xff, 0xff,
|
||||
0xcd, 0xff, 0xff, 0xff, 0xfd, 0x10, 0x0, 0x0,
|
||||
0x0, 0x0, 0x4f, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0x0, 0x5, 0xaf, 0xff, 0xff, 0xe1, 0x0, 0x0,
|
||||
0x0, 0x2, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0x0, 0x0, 0x3, 0xdf, 0xff, 0xfd, 0x0, 0x0,
|
||||
0x0, 0xd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0x0, 0x0, 0x0, 0xb, 0xff, 0xff, 0xa0, 0x0,
|
||||
0x0, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0x0, 0x0, 0x0, 0x0, 0xbf, 0xff, 0xf4, 0x0,
|
||||
0x1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0x0, 0x0, 0x0, 0x0, 0xd, 0xff, 0xfc, 0x0,
|
||||
0x7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0x0, 0x0, 0x0, 0x0, 0x3, 0xff, 0xff, 0x30,
|
||||
0xc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0xbf, 0xff, 0x90,
|
||||
0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x5f, 0xff, 0xd0,
|
||||
0x4f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x1f, 0xff, 0xf0,
|
||||
0x6f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0xe, 0xff, 0xf2,
|
||||
0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0xc, 0xff, 0xf3,
|
||||
0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0xc, 0xff, 0xf4,
|
||||
0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0xd, 0xff, 0xf3,
|
||||
0x5f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0xf, 0xff, 0xf1,
|
||||
0x2f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x3f, 0xff, 0xf0,
|
||||
0xe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x8f, 0xff, 0xb0,
|
||||
0x9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0x0, 0x0, 0x0, 0x0, 0x1, 0xff, 0xff, 0x60,
|
||||
0x3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0x0, 0x0, 0x0, 0x0, 0x9, 0xff, 0xff, 0x0,
|
||||
0x0, 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0x0, 0x0, 0x0, 0x0, 0x5f, 0xff, 0xf8, 0x0,
|
||||
0x0, 0x2f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0x0, 0x0, 0x0, 0x4, 0xff, 0xff, 0xe0, 0x0,
|
||||
0x0, 0x7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0x0, 0x0, 0x0, 0x6f, 0xff, 0xff, 0x30, 0x0,
|
||||
0x0, 0x0, 0x9f, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0x0, 0x0, 0x3c, 0xff, 0xff, 0xf6, 0x0, 0x0,
|
||||
0x0, 0x0, 0xa, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0x56, 0x9d, 0xff, 0xff, 0xff, 0x70, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x8f, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xf5, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x4, 0xdf, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xfb, 0x20, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x5, 0xcf, 0xff, 0xff,
|
||||
0xff, 0xff, 0xfb, 0x40, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x58, 0xab,
|
||||
0xba, 0x84, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
|
||||
/* U+F043 "" */
|
||||
0x0, 0x0, 0x0, 0x0, 0x4, 0xee, 0x40, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xd,
|
||||
|
|
@ -8268,51 +8334,52 @@ static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = {
|
|||
{.bitmap_index = 39760, .adv_w = 384, .box_w = 24, .box_h = 26, .ofs_x = 0, .ofs_y = -1},
|
||||
{.bitmap_index = 40072, .adv_w = 576, .box_w = 36, .box_h = 32, .ofs_x = 0, .ofs_y = -4},
|
||||
{.bitmap_index = 40648, .adv_w = 512, .box_w = 32, .box_h = 24, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 41032, .adv_w = 352, .box_w = 22, .box_h = 32, .ofs_x = 0, .ofs_y = -4},
|
||||
{.bitmap_index = 41384, .adv_w = 448, .box_w = 20, .box_h = 30, .ofs_x = 4, .ofs_y = -3},
|
||||
{.bitmap_index = 41684, .adv_w = 448, .box_w = 28, .box_h = 34, .ofs_x = 0, .ofs_y = -5},
|
||||
{.bitmap_index = 42160, .adv_w = 448, .box_w = 28, .box_h = 29, .ofs_x = 0, .ofs_y = -2},
|
||||
{.bitmap_index = 42566, .adv_w = 448, .box_w = 28, .box_h = 28, .ofs_x = 0, .ofs_y = -2},
|
||||
{.bitmap_index = 42958, .adv_w = 448, .box_w = 20, .box_h = 30, .ofs_x = 4, .ofs_y = -3},
|
||||
{.bitmap_index = 43258, .adv_w = 448, .box_w = 30, .box_h = 28, .ofs_x = -1, .ofs_y = -2},
|
||||
{.bitmap_index = 43678, .adv_w = 320, .box_w = 18, .box_h = 28, .ofs_x = 1, .ofs_y = -2},
|
||||
{.bitmap_index = 43930, .adv_w = 320, .box_w = 18, .box_h = 28, .ofs_x = 1, .ofs_y = -2},
|
||||
{.bitmap_index = 44182, .adv_w = 448, .box_w = 28, .box_h = 28, .ofs_x = 0, .ofs_y = -2},
|
||||
{.bitmap_index = 44574, .adv_w = 448, .box_w = 28, .box_h = 6, .ofs_x = 0, .ofs_y = 9},
|
||||
{.bitmap_index = 44658, .adv_w = 576, .box_w = 36, .box_h = 24, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 45090, .adv_w = 640, .box_w = 40, .box_h = 32, .ofs_x = 0, .ofs_y = -4},
|
||||
{.bitmap_index = 45730, .adv_w = 576, .box_w = 38, .box_h = 32, .ofs_x = -1, .ofs_y = -4},
|
||||
{.bitmap_index = 46338, .adv_w = 512, .box_w = 32, .box_h = 30, .ofs_x = 0, .ofs_y = -3},
|
||||
{.bitmap_index = 46818, .adv_w = 448, .box_w = 28, .box_h = 18, .ofs_x = 0, .ofs_y = 3},
|
||||
{.bitmap_index = 47070, .adv_w = 448, .box_w = 28, .box_h = 18, .ofs_x = 0, .ofs_y = 3},
|
||||
{.bitmap_index = 47322, .adv_w = 640, .box_w = 40, .box_h = 26, .ofs_x = 0, .ofs_y = -1},
|
||||
{.bitmap_index = 47842, .adv_w = 512, .box_w = 32, .box_h = 24, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 48226, .adv_w = 512, .box_w = 32, .box_h = 32, .ofs_x = 0, .ofs_y = -4},
|
||||
{.bitmap_index = 48738, .adv_w = 512, .box_w = 33, .box_h = 33, .ofs_x = -1, .ofs_y = -4},
|
||||
{.bitmap_index = 49283, .adv_w = 448, .box_w = 29, .box_h = 28, .ofs_x = 0, .ofs_y = -2},
|
||||
{.bitmap_index = 49689, .adv_w = 448, .box_w = 28, .box_h = 32, .ofs_x = 0, .ofs_y = -4},
|
||||
{.bitmap_index = 50137, .adv_w = 448, .box_w = 28, .box_h = 28, .ofs_x = 0, .ofs_y = -2},
|
||||
{.bitmap_index = 50529, .adv_w = 448, .box_w = 28, .box_h = 26, .ofs_x = 0, .ofs_y = -1},
|
||||
{.bitmap_index = 50893, .adv_w = 512, .box_w = 32, .box_h = 24, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 51277, .adv_w = 320, .box_w = 22, .box_h = 32, .ofs_x = -1, .ofs_y = -4},
|
||||
{.bitmap_index = 51629, .adv_w = 448, .box_w = 28, .box_h = 32, .ofs_x = 0, .ofs_y = -4},
|
||||
{.bitmap_index = 52077, .adv_w = 448, .box_w = 28, .box_h = 32, .ofs_x = 0, .ofs_y = -4},
|
||||
{.bitmap_index = 52525, .adv_w = 576, .box_w = 36, .box_h = 24, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 52957, .adv_w = 512, .box_w = 34, .box_h = 34, .ofs_x = -1, .ofs_y = -5},
|
||||
{.bitmap_index = 53535, .adv_w = 384, .box_w = 24, .box_h = 28, .ofs_x = 0, .ofs_y = -2},
|
||||
{.bitmap_index = 53871, .adv_w = 640, .box_w = 40, .box_h = 29, .ofs_x = 0, .ofs_y = -2},
|
||||
{.bitmap_index = 54451, .adv_w = 640, .box_w = 40, .box_h = 20, .ofs_x = 0, .ofs_y = 2},
|
||||
{.bitmap_index = 54851, .adv_w = 640, .box_w = 40, .box_h = 20, .ofs_x = 0, .ofs_y = 2},
|
||||
{.bitmap_index = 55251, .adv_w = 640, .box_w = 40, .box_h = 20, .ofs_x = 0, .ofs_y = 2},
|
||||
{.bitmap_index = 55651, .adv_w = 640, .box_w = 40, .box_h = 20, .ofs_x = 0, .ofs_y = 2},
|
||||
{.bitmap_index = 56051, .adv_w = 640, .box_w = 40, .box_h = 20, .ofs_x = 0, .ofs_y = 2},
|
||||
{.bitmap_index = 56451, .adv_w = 640, .box_w = 41, .box_h = 26, .ofs_x = 0, .ofs_y = -1},
|
||||
{.bitmap_index = 56984, .adv_w = 448, .box_w = 24, .box_h = 32, .ofs_x = 2, .ofs_y = -4},
|
||||
{.bitmap_index = 57368, .adv_w = 448, .box_w = 28, .box_h = 32, .ofs_x = 0, .ofs_y = -4},
|
||||
{.bitmap_index = 57816, .adv_w = 512, .box_w = 33, .box_h = 33, .ofs_x = -1, .ofs_y = -5},
|
||||
{.bitmap_index = 58361, .adv_w = 640, .box_w = 40, .box_h = 24, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 58841, .adv_w = 384, .box_w = 24, .box_h = 32, .ofs_x = 0, .ofs_y = -4},
|
||||
{.bitmap_index = 59225, .adv_w = 515, .box_w = 33, .box_h = 21, .ofs_x = 0, .ofs_y = 2}
|
||||
{.bitmap_index = 41032, .adv_w = 512, .box_w = 32, .box_h = 32, .ofs_x = 0, .ofs_y = -4},
|
||||
{.bitmap_index = 41544, .adv_w = 352, .box_w = 22, .box_h = 32, .ofs_x = 0, .ofs_y = -4},
|
||||
{.bitmap_index = 41896, .adv_w = 448, .box_w = 20, .box_h = 30, .ofs_x = 4, .ofs_y = -3},
|
||||
{.bitmap_index = 42196, .adv_w = 448, .box_w = 28, .box_h = 34, .ofs_x = 0, .ofs_y = -5},
|
||||
{.bitmap_index = 42672, .adv_w = 448, .box_w = 28, .box_h = 29, .ofs_x = 0, .ofs_y = -2},
|
||||
{.bitmap_index = 43078, .adv_w = 448, .box_w = 28, .box_h = 28, .ofs_x = 0, .ofs_y = -2},
|
||||
{.bitmap_index = 43470, .adv_w = 448, .box_w = 20, .box_h = 30, .ofs_x = 4, .ofs_y = -3},
|
||||
{.bitmap_index = 43770, .adv_w = 448, .box_w = 30, .box_h = 28, .ofs_x = -1, .ofs_y = -2},
|
||||
{.bitmap_index = 44190, .adv_w = 320, .box_w = 18, .box_h = 28, .ofs_x = 1, .ofs_y = -2},
|
||||
{.bitmap_index = 44442, .adv_w = 320, .box_w = 18, .box_h = 28, .ofs_x = 1, .ofs_y = -2},
|
||||
{.bitmap_index = 44694, .adv_w = 448, .box_w = 28, .box_h = 28, .ofs_x = 0, .ofs_y = -2},
|
||||
{.bitmap_index = 45086, .adv_w = 448, .box_w = 28, .box_h = 6, .ofs_x = 0, .ofs_y = 9},
|
||||
{.bitmap_index = 45170, .adv_w = 576, .box_w = 36, .box_h = 24, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 45602, .adv_w = 640, .box_w = 40, .box_h = 32, .ofs_x = 0, .ofs_y = -4},
|
||||
{.bitmap_index = 46242, .adv_w = 576, .box_w = 38, .box_h = 32, .ofs_x = -1, .ofs_y = -4},
|
||||
{.bitmap_index = 46850, .adv_w = 512, .box_w = 32, .box_h = 30, .ofs_x = 0, .ofs_y = -3},
|
||||
{.bitmap_index = 47330, .adv_w = 448, .box_w = 28, .box_h = 18, .ofs_x = 0, .ofs_y = 3},
|
||||
{.bitmap_index = 47582, .adv_w = 448, .box_w = 28, .box_h = 18, .ofs_x = 0, .ofs_y = 3},
|
||||
{.bitmap_index = 47834, .adv_w = 640, .box_w = 40, .box_h = 26, .ofs_x = 0, .ofs_y = -1},
|
||||
{.bitmap_index = 48354, .adv_w = 512, .box_w = 32, .box_h = 24, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 48738, .adv_w = 512, .box_w = 32, .box_h = 32, .ofs_x = 0, .ofs_y = -4},
|
||||
{.bitmap_index = 49250, .adv_w = 512, .box_w = 33, .box_h = 33, .ofs_x = -1, .ofs_y = -4},
|
||||
{.bitmap_index = 49795, .adv_w = 448, .box_w = 29, .box_h = 28, .ofs_x = 0, .ofs_y = -2},
|
||||
{.bitmap_index = 50201, .adv_w = 448, .box_w = 28, .box_h = 32, .ofs_x = 0, .ofs_y = -4},
|
||||
{.bitmap_index = 50649, .adv_w = 448, .box_w = 28, .box_h = 28, .ofs_x = 0, .ofs_y = -2},
|
||||
{.bitmap_index = 51041, .adv_w = 448, .box_w = 28, .box_h = 26, .ofs_x = 0, .ofs_y = -1},
|
||||
{.bitmap_index = 51405, .adv_w = 512, .box_w = 32, .box_h = 24, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 51789, .adv_w = 320, .box_w = 22, .box_h = 32, .ofs_x = -1, .ofs_y = -4},
|
||||
{.bitmap_index = 52141, .adv_w = 448, .box_w = 28, .box_h = 32, .ofs_x = 0, .ofs_y = -4},
|
||||
{.bitmap_index = 52589, .adv_w = 448, .box_w = 28, .box_h = 32, .ofs_x = 0, .ofs_y = -4},
|
||||
{.bitmap_index = 53037, .adv_w = 576, .box_w = 36, .box_h = 24, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 53469, .adv_w = 512, .box_w = 34, .box_h = 34, .ofs_x = -1, .ofs_y = -5},
|
||||
{.bitmap_index = 54047, .adv_w = 384, .box_w = 24, .box_h = 28, .ofs_x = 0, .ofs_y = -2},
|
||||
{.bitmap_index = 54383, .adv_w = 640, .box_w = 40, .box_h = 29, .ofs_x = 0, .ofs_y = -2},
|
||||
{.bitmap_index = 54963, .adv_w = 640, .box_w = 40, .box_h = 20, .ofs_x = 0, .ofs_y = 2},
|
||||
{.bitmap_index = 55363, .adv_w = 640, .box_w = 40, .box_h = 20, .ofs_x = 0, .ofs_y = 2},
|
||||
{.bitmap_index = 55763, .adv_w = 640, .box_w = 40, .box_h = 20, .ofs_x = 0, .ofs_y = 2},
|
||||
{.bitmap_index = 56163, .adv_w = 640, .box_w = 40, .box_h = 20, .ofs_x = 0, .ofs_y = 2},
|
||||
{.bitmap_index = 56563, .adv_w = 640, .box_w = 40, .box_h = 20, .ofs_x = 0, .ofs_y = 2},
|
||||
{.bitmap_index = 56963, .adv_w = 640, .box_w = 41, .box_h = 26, .ofs_x = 0, .ofs_y = -1},
|
||||
{.bitmap_index = 57496, .adv_w = 448, .box_w = 24, .box_h = 32, .ofs_x = 2, .ofs_y = -4},
|
||||
{.bitmap_index = 57880, .adv_w = 448, .box_w = 28, .box_h = 32, .ofs_x = 0, .ofs_y = -4},
|
||||
{.bitmap_index = 58328, .adv_w = 512, .box_w = 33, .box_h = 33, .ofs_x = -1, .ofs_y = -5},
|
||||
{.bitmap_index = 58873, .adv_w = 640, .box_w = 40, .box_h = 24, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 59353, .adv_w = 384, .box_w = 24, .box_h = 32, .ofs_x = 0, .ofs_y = -4},
|
||||
{.bitmap_index = 59737, .adv_w = 515, .box_w = 33, .box_h = 21, .ofs_x = 0, .ofs_y = 2}
|
||||
};
|
||||
|
||||
/*---------------------
|
||||
|
|
@ -8321,13 +8388,13 @@ static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = {
|
|||
|
||||
static const uint16_t unicode_list_2[] = {
|
||||
0x0, 0x7, 0xa, 0xb, 0xc, 0x10, 0x12, 0x14,
|
||||
0x18, 0x1b, 0x20, 0x25, 0x26, 0x27, 0x3d, 0x42,
|
||||
0x47, 0x4a, 0x4b, 0x4c, 0x50, 0x51, 0x52, 0x53,
|
||||
0x66, 0x67, 0x6d, 0x6f, 0x70, 0x73, 0x76, 0x77,
|
||||
0x78, 0x7a, 0x92, 0x94, 0xc3, 0xc4, 0xc6, 0xc8,
|
||||
0xdf, 0xe6, 0xe9, 0xf2, 0x11b, 0x123, 0x157, 0x1ea,
|
||||
0x23f, 0x240, 0x241, 0x242, 0x243, 0x286, 0x292, 0x2ec,
|
||||
0x303, 0x559, 0x7c1, 0x8a1
|
||||
0x18, 0x1b, 0x20, 0x25, 0x26, 0x27, 0x3d, 0x41,
|
||||
0x42, 0x47, 0x4a, 0x4b, 0x4c, 0x50, 0x51, 0x52,
|
||||
0x53, 0x66, 0x67, 0x6d, 0x6f, 0x70, 0x73, 0x76,
|
||||
0x77, 0x78, 0x7a, 0x92, 0x94, 0xc3, 0xc4, 0xc6,
|
||||
0xc8, 0xdf, 0xe6, 0xe9, 0xf2, 0x11b, 0x123, 0x157,
|
||||
0x1ea, 0x23f, 0x240, 0x241, 0x242, 0x243, 0x286, 0x292,
|
||||
0x2ec, 0x303, 0x559, 0x7c1, 0x8a1
|
||||
};
|
||||
|
||||
/*Collect the unicode lists and glyph_id offsets*/
|
||||
|
|
@ -8343,7 +8410,7 @@ static const lv_font_fmt_txt_cmap_t cmaps[] =
|
|||
},
|
||||
{
|
||||
.range_start = 61441, .range_length = 2210, .glyph_id_start = 192,
|
||||
.unicode_list = unicode_list_2, .glyph_id_ofs_list = NULL, .list_length = 60, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY
|
||||
.unicode_list = unicode_list_2, .glyph_id_ofs_list = NULL, .list_length = 61, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -8386,7 +8453,7 @@ static const uint8_t kern_left_class_mapping[] =
|
|||
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
|
||||
};
|
||||
|
||||
/*Map glyph_ids to kern right classes*/
|
||||
|
|
@ -8423,7 +8490,7 @@ static const uint8_t kern_right_class_mapping[] =
|
|||
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
|
||||
};
|
||||
|
||||
/*Kern values between classes*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue