-
-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ui: watchface: Add new watchface options. Digital and minimal.
- Loading branch information
Showing
16 changed files
with
1,680 additions
and
6 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,242 @@ | ||
/******************************************************************************* | ||
* Size: 25 px | ||
* Bpp: 2 | ||
* Opts: --bpp 2 --size 25 --font /home/jakkra/SquareLine/assets/AlienInvader-PKnPm.ttf -o /home/jakkra/SquareLine/assets/ui_font_aliean_25.c --format lvgl --symbols 0123456789: --no-compress --no-prefilter | ||
******************************************************************************/ | ||
|
||
#if defined(LV_LVGL_H_INCLUDE_SIMPLE) | ||
#include "lvgl.h" | ||
#else | ||
#include "lvgl/lvgl.h" | ||
#endif | ||
|
||
#ifndef UI_FONT_ALIEAN_25 | ||
#define UI_FONT_ALIEAN_25 1 | ||
#endif | ||
|
||
#if UI_FONT_ALIEAN_25 | ||
|
||
/*----------------- | ||
* BITMAPS | ||
*----------------*/ | ||
|
||
/*Store the image of the glyphs*/ | ||
static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { | ||
/* U+0030 "0" */ | ||
0xb, 0xff, 0xff, 0xff, 0xd0, 0x3f, 0xff, 0xff, | ||
0xff, 0xf8, 0xbf, 0xff, 0xff, 0xff, 0xfc, 0xff, | ||
0xff, 0xff, 0xff, 0xfd, 0xff, 0xff, 0xff, 0xff, | ||
0xfe, 0xff, 0xc0, 0x0, 0x7, 0xfe, 0xff, 0xc0, | ||
0x0, 0x7, 0xfe, 0xff, 0xc0, 0x0, 0x7, 0xfe, | ||
0xff, 0xc0, 0x0, 0x7, 0xfe, 0xff, 0xc0, 0x0, | ||
0x7, 0xfe, 0xff, 0xc0, 0x0, 0x7, 0xfe, 0xff, | ||
0xc0, 0x0, 0x7, 0xfe, 0xff, 0xff, 0xff, 0xff, | ||
0xfe, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xbf, 0xff, | ||
0xff, 0xff, 0xfc, 0x3f, 0xff, 0xff, 0xff, 0xf8, | ||
0xb, 0xff, 0xff, 0xff, 0xd0, | ||
|
||
/* U+0031 "1" */ | ||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, | ||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, | ||
0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, | ||
|
||
/* U+0032 "2" */ | ||
0xff, 0xff, 0xff, 0xff, 0xd0, 0xff, 0xff, 0xff, | ||
0xff, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xff, | ||
0xff, 0xff, 0xff, 0xfd, 0xff, 0xff, 0xff, 0xff, | ||
0xfe, 0x0, 0x0, 0x0, 0x7, 0xfe, 0x6, 0xff, | ||
0xff, 0xff, 0xfe, 0x3f, 0xff, 0xff, 0xff, 0xfd, | ||
0xbf, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, | ||
0xff, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xd0, 0xff, | ||
0xc0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xff, | ||
0xfd, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, | ||
0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xfe, | ||
0xff, 0xff, 0xff, 0xff, 0xfe, | ||
|
||
/* U+0033 "3" */ | ||
0xff, 0xff, 0xff, 0xff, 0xd0, 0xff, 0xff, 0xff, | ||
0xff, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xff, | ||
0xff, 0xff, 0xff, 0xfd, 0xff, 0xff, 0xff, 0xff, | ||
0xfe, 0x0, 0x0, 0x0, 0x7, 0xfe, 0xff, 0xff, | ||
0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xfe, | ||
0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, | ||
0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, | ||
0x0, 0x0, 0x7, 0xfe, 0xff, 0xff, 0xff, 0xff, | ||
0xfe, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xff, 0xff, | ||
0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xf8, | ||
0xff, 0xff, 0xff, 0xff, 0xd0, | ||
|
||
/* U+0034 "4" */ | ||
0xff, 0xc0, 0x0, 0x7, 0xfe, 0xff, 0xc0, 0x0, | ||
0x7, 0xfe, 0xff, 0xc0, 0x0, 0x7, 0xfe, 0xff, | ||
0xc0, 0x0, 0x7, 0xfe, 0xff, 0xc0, 0x0, 0x7, | ||
0xfe, 0xff, 0xc0, 0x0, 0x7, 0xfe, 0xff, 0xff, | ||
0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xfe, | ||
0xbf, 0xff, 0xff, 0xff, 0xfe, 0x3f, 0xff, 0xff, | ||
0xff, 0xfe, 0xb, 0xff, 0xff, 0xff, 0xfe, 0x0, | ||
0x0, 0x0, 0x7, 0xfe, 0x0, 0x0, 0x0, 0x7, | ||
0xfe, 0x0, 0x0, 0x0, 0x7, 0xfe, 0x0, 0x0, | ||
0x0, 0x7, 0xfe, 0x0, 0x0, 0x0, 0x7, 0xfe, | ||
0x0, 0x0, 0x0, 0x7, 0xfe, | ||
|
||
/* U+0035 "5" */ | ||
0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, | ||
0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, | ||
0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, | ||
0xfd, 0xff, 0xc0, 0x0, 0x0, 0x0, 0xff, 0xff, | ||
0xff, 0xff, 0x80, 0xff, 0xff, 0xff, 0xff, 0xf4, | ||
0xbf, 0xff, 0xff, 0xff, 0xfc, 0x3f, 0xff, 0xff, | ||
0xff, 0xfd, 0xb, 0xff, 0xff, 0xff, 0xfd, 0x0, | ||
0x0, 0x0, 0x7, 0xfe, 0xff, 0xff, 0xff, 0xff, | ||
0xfe, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xff, 0xff, | ||
0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xf8, | ||
0xff, 0xff, 0xff, 0xff, 0xd0, | ||
|
||
/* U+0036 "6" */ | ||
0xb, 0xff, 0xff, 0xff, 0xf4, 0x3f, 0xff, 0xff, | ||
0xff, 0xf4, 0xbf, 0xff, 0xff, 0xff, 0xf4, 0xff, | ||
0xff, 0xff, 0xff, 0xf4, 0xff, 0xff, 0xff, 0xff, | ||
0xf4, 0xff, 0xc0, 0x0, 0x0, 0x0, 0xff, 0xff, | ||
0xff, 0xff, 0x80, 0xff, 0xff, 0xff, 0xff, 0xf4, | ||
0xff, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, | ||
0xff, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xff, | ||
0xc0, 0x0, 0x7, 0xfe, 0xff, 0xff, 0xff, 0xff, | ||
0xfe, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xbf, 0xff, | ||
0xff, 0xff, 0xfc, 0x3f, 0xff, 0xff, 0xff, 0xf8, | ||
0xb, 0xff, 0xff, 0xff, 0xd0, | ||
|
||
/* U+0037 "7" */ | ||
0xff, 0xff, 0xff, 0xff, 0xfd, 0xff, 0xff, 0xff, | ||
0xff, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xf8, 0xff, | ||
0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, | ||
0xf0, 0x0, 0x0, 0x0, 0xff, 0xd0, 0x0, 0x0, | ||
0x1, 0xff, 0xc0, 0x0, 0x0, 0x3, 0xff, 0x80, | ||
0x0, 0x0, 0x7, 0xff, 0x0, 0x0, 0x0, 0xb, | ||
0xff, 0x0, 0x0, 0x0, 0xf, 0xfd, 0x0, 0x0, | ||
0x0, 0x1f, 0xfc, 0x0, 0x0, 0x0, 0x3f, 0xf8, | ||
0x0, 0x0, 0x0, 0x7f, 0xf0, 0x0, 0x0, 0x0, | ||
0xbf, 0xf0, 0x0, 0x0, 0x0, 0xff, 0xd0, 0x0, | ||
0x0, 0x1, 0xff, 0xc0, 0x0, | ||
|
||
/* U+0038 "8" */ | ||
0xb, 0xff, 0xff, 0xff, 0xd0, 0x3f, 0xff, 0xff, | ||
0xff, 0xf8, 0xbf, 0xff, 0xff, 0xff, 0xfc, 0xff, | ||
0xff, 0xff, 0xff, 0xfd, 0xff, 0xff, 0xff, 0xff, | ||
0xfe, 0xff, 0xc0, 0x0, 0x7, 0xfd, 0xbf, 0xff, | ||
0xff, 0xff, 0xfc, 0x3f, 0xff, 0xff, 0xff, 0xf8, | ||
0x1f, 0xff, 0xff, 0xff, 0xf0, 0x3f, 0xff, 0xff, | ||
0xff, 0xf4, 0xbf, 0xff, 0xff, 0xff, 0xfc, 0xff, | ||
0xc0, 0x0, 0x7, 0xfd, 0xff, 0xff, 0xff, 0xff, | ||
0xfe, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xbf, 0xff, | ||
0xff, 0xff, 0xfc, 0x3f, 0xff, 0xff, 0xff, 0xf8, | ||
0xb, 0xff, 0xff, 0xff, 0xd0, | ||
|
||
/* U+0039 "9" */ | ||
0xb, 0xff, 0xff, 0xff, 0xd0, 0x3f, 0xff, 0xff, | ||
0xff, 0xf8, 0xbf, 0xff, 0xff, 0xff, 0xfc, 0xff, | ||
0xff, 0xff, 0xff, 0xfd, 0xff, 0xff, 0xff, 0xff, | ||
0xfe, 0xff, 0xc0, 0x0, 0x7, 0xfe, 0xff, 0xff, | ||
0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xfe, | ||
0xbf, 0xff, 0xff, 0xff, 0xfe, 0x3f, 0xff, 0xff, | ||
0xff, 0xfe, 0xb, 0xff, 0xff, 0xff, 0xfe, 0x0, | ||
0x0, 0x0, 0x7, 0xfe, 0x2f, 0xff, 0xff, 0xff, | ||
0xfe, 0x3f, 0xff, 0xff, 0xff, 0xfd, 0x3f, 0xff, | ||
0xff, 0xff, 0xfc, 0x3f, 0xff, 0xff, 0xff, 0xf8, | ||
0x3f, 0xff, 0xff, 0xff, 0xd0, | ||
|
||
/* U+003A ":" */ | ||
0x2e, 0x2f, 0xef, 0xff, 0xfe, 0x3e, 0x0, 0x2, | ||
0xe2, 0xfe, 0xff, 0xff, 0xe3, 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 = 332, .box_w = 20, .box_h = 17, .ofs_x = 0, .ofs_y = 0}, | ||
{.bitmap_index = 85, .adv_w = 98, .box_w = 5, .box_h = 17, .ofs_x = 0, .ofs_y = 0}, | ||
{.bitmap_index = 107, .adv_w = 332, .box_w = 20, .box_h = 17, .ofs_x = 0, .ofs_y = 0}, | ||
{.bitmap_index = 192, .adv_w = 332, .box_w = 20, .box_h = 17, .ofs_x = 0, .ofs_y = 0}, | ||
{.bitmap_index = 277, .adv_w = 332, .box_w = 20, .box_h = 17, .ofs_x = 0, .ofs_y = 0}, | ||
{.bitmap_index = 362, .adv_w = 332, .box_w = 20, .box_h = 17, .ofs_x = 0, .ofs_y = 0}, | ||
{.bitmap_index = 447, .adv_w = 332, .box_w = 20, .box_h = 17, .ofs_x = 0, .ofs_y = 0}, | ||
{.bitmap_index = 532, .adv_w = 332, .box_w = 20, .box_h = 17, .ofs_x = 0, .ofs_y = 0}, | ||
{.bitmap_index = 617, .adv_w = 332, .box_w = 20, .box_h = 17, .ofs_x = 0, .ofs_y = 0}, | ||
{.bitmap_index = 702, .adv_w = 332, .box_w = 20, .box_h = 17, .ofs_x = 0, .ofs_y = 0}, | ||
{.bitmap_index = 787, .adv_w = 98, .box_w = 5, .box_h = 11, .ofs_x = 0, .ofs_y = 0} | ||
}; | ||
|
||
/*--------------------- | ||
* CHARACTER MAPPING | ||
*--------------------*/ | ||
|
||
|
||
|
||
/*Collect the unicode lists and glyph_id offsets*/ | ||
static const lv_font_fmt_txt_cmap_t cmaps[] = | ||
{ | ||
{ | ||
.range_start = 48, .range_length = 11, .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 LV_VERSION_CHECK(8, 0, 0) | ||
/*Store all the custom data of the font*/ | ||
static lv_font_fmt_txt_glyph_cache_t cache; | ||
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 LV_VERSION_CHECK(8, 0, 0) | ||
.cache = &cache | ||
#endif | ||
}; | ||
|
||
|
||
/*----------------- | ||
* PUBLIC FONT | ||
*----------------*/ | ||
|
||
/*Initialize a public general font descriptor*/ | ||
#if LV_VERSION_CHECK(8, 0, 0) | ||
const lv_font_t ui_font_aliean_25 = { | ||
#else | ||
lv_font_t ui_font_aliean_25 = { | ||
#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 = 17, /*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 = -3, | ||
.underline_thickness = 2, | ||
#endif | ||
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ | ||
}; | ||
|
||
|
||
|
||
#endif /*#if UI_FONT_ALIEAN_25*/ | ||
|
Oops, something went wrong.