diff --git a/core/SConscript.firmware b/core/SConscript.firmware index f1c5aac7d..fcd21a97a 100644 --- a/core/SConscript.firmware +++ b/core/SConscript.firmware @@ -153,6 +153,9 @@ SOURCE_MOD += [ 'embed/extmod/modtrezorui/font_roboto_bold_20.c', 'embed/extmod/modtrezorui/font_roboto_regular_20.c', 'embed/extmod/modtrezorui/font_robotomono_regular_20.c', + 'embed/extmod/modtrezorui/font_pixeloperator_bold_8.c', + 'embed/extmod/modtrezorui/font_pixeloperator_regular_8.c', + 'embed/extmod/modtrezorui/font_pixeloperatormono_regular_8.c', 'embed/extmod/modtrezorui/modtrezorui.c', 'embed/extmod/modtrezorui/qr-code-generator/qrcodegen.c', 'vendor/micropython/extmod/uzlib/adler32.c', diff --git a/core/SConscript.unix b/core/SConscript.unix index 56a54a735..3eb9e0f70 100644 --- a/core/SConscript.unix +++ b/core/SConscript.unix @@ -147,6 +147,9 @@ SOURCE_MOD += [ 'embed/extmod/modtrezorui/font_roboto_bold_20.c', 'embed/extmod/modtrezorui/font_roboto_regular_20.c', 'embed/extmod/modtrezorui/font_robotomono_regular_20.c', + 'embed/extmod/modtrezorui/font_pixeloperator_bold_8.c', + 'embed/extmod/modtrezorui/font_pixeloperator_regular_8.c', + 'embed/extmod/modtrezorui/font_pixeloperatormono_regular_8.c', 'embed/extmod/modtrezorui/modtrezorui.c', 'embed/extmod/modtrezorui/qr-code-generator/qrcodegen.c', 'vendor/micropython/extmod/uzlib/adler32.c', diff --git a/core/embed/extmod/modtrezorui/display.c b/core/embed/extmod/modtrezorui/display.c index cf364541e..eb7f70b84 100644 --- a/core/embed/extmod/modtrezorui/display.c +++ b/core/embed/extmod/modtrezorui/display.c @@ -19,17 +19,6 @@ #define _GNU_SOURCE -#include "font_bitmap.h" -#ifdef TREZOR_FONT_NORMAL_ENABLE -#include "font_roboto_regular_20.h" -#endif -#ifdef TREZOR_FONT_BOLD_ENABLE -#include "font_roboto_bold_20.h" -#endif -#ifdef TREZOR_FONT_MONO_ENABLE -#include "font_robotomono_regular_20.h" -#endif - #include "qr-code-generator/qrcodegen.h" #include "uzlib.h" @@ -37,6 +26,42 @@ #include "common.h" #include "display.h" +#include "font_bitmap.h" + +#if TREZOR_MODEL == T + +#ifdef TREZOR_FONT_NORMAL_ENABLE +#include "font_roboto_regular_20.h" +#define FONT_NORMAL_DATA Font_Roboto_Regular_20 +#endif +#ifdef TREZOR_FONT_BOLD_ENABLE +#include "font_roboto_bold_20.h" +#define FONT_BOLD_DATA Font_Roboto_Bold_20 +#endif +#ifdef TREZOR_FONT_MONO_ENABLE +#include "font_robotomono_regular_20.h" +#define FONT_MONO_DATA Font_RobotoMono_Regular_20 +#endif + +#elif TREZOR_MODEL == 1 + +#ifdef TREZOR_FONT_NORMAL_ENABLE +#include "font_pixeloperator_regular_8.h" +#define FONT_NORMAL_DATA Font_PixelOperator_Regular_8 +#endif +#ifdef TREZOR_FONT_BOLD_ENABLE +#include "font_pixeloperator_bold_8.h" +#define FONT_BOLD_DATA Font_PixelOperator_Bold_8 +#endif +#ifdef TREZOR_FONT_MONO_ENABLE +#include "font_pixeloperatormono_regular_8.h" +#define FONT_MONO_DATA Font_PixelOperatorMono_Regular_8 +#endif + +#else +#error Unknown Trezor model +#endif + #include #include @@ -566,33 +591,36 @@ static const uint8_t *get_glyph(int font, uint8_t c) { switch (font) { #ifdef TREZOR_FONT_NORMAL_ENABLE case FONT_NORMAL: - return Font_Roboto_Regular_20[c - ' ']; + return FONT_NORMAL_DATA[c - ' ']; #endif #ifdef TREZOR_FONT_BOLD_ENABLE case FONT_BOLD: - return Font_Roboto_Bold_20[c - ' ']; + return FONT_BOLD_DATA[c - ' ']; #endif #ifdef TREZOR_FONT_MONO_ENABLE case FONT_MONO: - return Font_RobotoMono_Regular_20[c - ' ']; + return FONT_MONO_DATA[c - ' ']; #endif } return 0; } - // non-printable character +// non-printable character +#define PASTER(s) s##_glyph_nonprintable +#define NONPRINTABLE_GLYPH(s) PASTER(s) + switch (font) { #ifdef TREZOR_FONT_NORMAL_ENABLE case FONT_NORMAL: - return Font_Roboto_Regular_20_glyph_nonprintable; + return NONPRINTABLE_GLYPH(FONT_NORMAL_DATA); #endif #ifdef TREZOR_FONT_BOLD_ENABLE case FONT_BOLD: - return Font_Roboto_Bold_20_glyph_nonprintable; + return NONPRINTABLE_GLYPH(FONT_BOLD_DATA); #endif #ifdef TREZOR_FONT_MONO_ENABLE case FONT_MONO: - return Font_RobotoMono_Regular_20_glyph_nonprintable; + return NONPRINTABLE_GLYPH(FONT_MONO_DATA); #endif } return 0; @@ -628,12 +656,16 @@ static void display_text_render(int x, int y, const char *text, int textlen, const int rx = i - sx; const int ry = j - sy; const int a = rx + ry * w; -#if FONT_BPP == 2 +#if TREZOR_FONT_BPP == 1 + const uint8_t c = ((g[5 + a / 8] >> (7 - (a % 8) * 1)) & 0x01) * 15; +#elif TREZOR_FONT_BPP == 2 const uint8_t c = ((g[5 + a / 4] >> (6 - (a % 4) * 2)) & 0x03) * 5; -#elif FONT_BPP == 4 +#elif TREZOR_FONT_BPP == 4 const uint8_t c = (g[5 + a / 2] >> (4 - (a % 2) * 4)) & 0x0F; +#elif TREZOR_FONT_BPP == 8 + const uint8_t c = g[5 + a / 1] >> 4; #else -#error Unsupported FONT_BPP value +#error Unsupported TREZOR_FONT_BPP value #endif PIXELDATA(colortable[c]); } diff --git a/core/embed/extmod/modtrezorui/display.h b/core/embed/extmod/modtrezorui/display.h index a8f8058bd..7aa7ec2fe 100644 --- a/core/embed/extmod/modtrezorui/display.h +++ b/core/embed/extmod/modtrezorui/display.h @@ -30,6 +30,7 @@ #define MAX_DISPLAY_RESY 320 #define DISPLAY_RESX 240 #define DISPLAY_RESY 240 +#define TREZOR_FONT_BPP 4 #elif TREZOR_MODEL == 1 @@ -37,12 +38,12 @@ #define MAX_DISPLAY_RESY 64 #define DISPLAY_RESX 128 #define DISPLAY_RESY 64 +#define TREZOR_FONT_BPP 1 #else #error Unknown Trezor model #endif -#define FONT_BPP 4 #define FONT_SIZE 20 #define AVATAR_IMAGE_SIZE 144 #define LOADER_ICON_SIZE 64 diff --git a/core/embed/extmod/modtrezorui/font_pixeloperator_bold_8.c b/core/embed/extmod/modtrezorui/font_pixeloperator_bold_8.c new file mode 100644 index 000000000..02abc63a3 --- /dev/null +++ b/core/embed/extmod/modtrezorui/font_pixeloperator_bold_8.c @@ -0,0 +1,204 @@ +#include + +// first two bytes are width and height of the glyph +// third, fourth and fifth bytes are advance +// bearingX and bearingY of the horizontal metrics of the glyph +// rest is packed 4-bit glyph data + +// clang-format off + +/* */ static const uint8_t Font_PixelOperator_Bold_8_glyph_32[] = { 0, 0, 4, 0, 0 }; +/* ! */ static const uint8_t Font_PixelOperator_Bold_8_glyph_33[] = { 2, 7, 6, 2, 7, 255, 204 }; +/* " */ static const uint8_t Font_PixelOperator_Bold_8_glyph_34[] = { 5, 3, 7, 1, 7, 222, 246 }; +/* # */ static const uint8_t Font_PixelOperator_Bold_8_glyph_35[] = { 7, 6, 9, 1, 6, 109, 253, 179, 111, 237, 128 }; +/* $ */ static const uint8_t Font_PixelOperator_Bold_8_glyph_36[] = { 7, 7, 9, 1, 7, 16, 251, 67, 225, 127, 132, 0 }; +/* % */ static const uint8_t Font_PixelOperator_Bold_8_glyph_37[] = { 12, 7, 14, 1, 7, 112, 141, 152, 219, 7, 110, 13, 177, 155, 16, 224 }; +/* & */ static const uint8_t Font_PixelOperator_Bold_8_glyph_38[] = { 6, 7, 8, 1, 7, 123, 60, 30, 207, 55, 192 }; +/* ' */ static const uint8_t Font_PixelOperator_Bold_8_glyph_39[] = { 2, 3, 6, 2, 7, 252 }; +/* ( */ static const uint8_t Font_PixelOperator_Bold_8_glyph_40[] = { 4, 7, 8, 3, 7, 54, 204, 198, 48 }; +/* ) */ static const uint8_t Font_PixelOperator_Bold_8_glyph_41[] = { 4, 7, 8, 1, 7, 198, 51, 54, 192 }; +/* * */ static const uint8_t Font_PixelOperator_Bold_8_glyph_42[] = { 5, 7, 7, 1, 7, 37, 126, 239, 212, 128 }; +/* + */ static const uint8_t Font_PixelOperator_Bold_8_glyph_43[] = { 6, 5, 8, 1, 6, 48, 207, 204, 48 }; +/* , */ static const uint8_t Font_PixelOperator_Bold_8_glyph_44[] = { 3, 3, 6, 1, 2, 111, 0 }; +/* - */ static const uint8_t Font_PixelOperator_Bold_8_glyph_45[] = { 4, 1, 6, 1, 4, 240 }; +/* . */ static const uint8_t Font_PixelOperator_Bold_8_glyph_46[] = { 2, 1, 6, 2, 1, 192 }; +/* / */ static const uint8_t Font_PixelOperator_Bold_8_glyph_47[] = { 4, 7, 6, 1, 7, 51, 102, 108, 192 }; +/* 0 */ static const uint8_t Font_PixelOperator_Bold_8_glyph_48[] = { 6, 7, 8, 1, 7, 123, 61, 255, 239, 55, 128 }; +/* 1 */ static const uint8_t Font_PixelOperator_Bold_8_glyph_49[] = { 4, 7, 8, 2, 7, 55, 251, 51, 48 }; +/* 2 */ static const uint8_t Font_PixelOperator_Bold_8_glyph_50[] = { 6, 7, 8, 1, 7, 123, 48, 198, 49, 143, 192 }; +/* 3 */ static const uint8_t Font_PixelOperator_Bold_8_glyph_51[] = { 6, 7, 8, 1, 7, 123, 48, 206, 15, 55, 128 }; +/* 4 */ static const uint8_t Font_PixelOperator_Bold_8_glyph_52[] = { 6, 7, 8, 1, 7, 28, 246, 243, 252, 48, 192 }; +/* 5 */ static const uint8_t Font_PixelOperator_Bold_8_glyph_53[] = { 6, 7, 8, 1, 7, 255, 15, 131, 15, 55, 128 }; +/* 6 */ static const uint8_t Font_PixelOperator_Bold_8_glyph_54[] = { 6, 7, 8, 1, 7, 123, 60, 62, 207, 55, 128 }; +/* 7 */ static const uint8_t Font_PixelOperator_Bold_8_glyph_55[] = { 6, 7, 8, 1, 7, 252, 49, 140, 99, 12, 0 }; +/* 8 */ static const uint8_t Font_PixelOperator_Bold_8_glyph_56[] = { 6, 7, 8, 1, 7, 123, 60, 222, 207, 55, 128 }; +/* 9 */ static const uint8_t Font_PixelOperator_Bold_8_glyph_57[] = { 6, 7, 8, 1, 7, 123, 60, 223, 15, 55, 128 }; +/* : */ static const uint8_t Font_PixelOperator_Bold_8_glyph_58[] = { 2, 5, 6, 2, 5, 192, 192 }; +/* ; */ static const uint8_t Font_PixelOperator_Bold_8_glyph_59[] = { 3, 6, 6, 1, 5, 96, 55, 128 }; +/* < */ static const uint8_t Font_PixelOperator_Bold_8_glyph_60[] = { 4, 5, 6, 1, 6, 54, 198, 48 }; +/* = */ static const uint8_t Font_PixelOperator_Bold_8_glyph_61[] = { 4, 3, 6, 1, 5, 240, 240 }; +/* > */ static const uint8_t Font_PixelOperator_Bold_8_glyph_62[] = { 4, 5, 6, 1, 6, 198, 54, 192 }; +/* ? */ static const uint8_t Font_PixelOperator_Bold_8_glyph_63[] = { 6, 7, 8, 1, 7, 123, 48, 198, 48, 3, 0 }; +/* @ */ static const uint8_t Font_PixelOperator_Bold_8_glyph_64[] = { 7, 8, 9, 1, 7, 125, 6, 109, 90, 179, 160, 62, 0 }; +/* A */ static const uint8_t Font_PixelOperator_Bold_8_glyph_65[] = { 6, 7, 8, 1, 7, 123, 60, 243, 255, 60, 192 }; +/* B */ static const uint8_t Font_PixelOperator_Bold_8_glyph_66[] = { 6, 7, 8, 1, 7, 251, 60, 254, 207, 63, 128 }; +/* C */ static const uint8_t Font_PixelOperator_Bold_8_glyph_67[] = { 6, 7, 8, 1, 7, 123, 60, 48, 195, 55, 128 }; +/* D */ static const uint8_t Font_PixelOperator_Bold_8_glyph_68[] = { 6, 7, 8, 1, 7, 251, 60, 243, 207, 63, 128 }; +/* E */ static const uint8_t Font_PixelOperator_Bold_8_glyph_69[] = { 6, 7, 8, 1, 7, 255, 12, 60, 195, 15, 192 }; +/* F */ static const uint8_t Font_PixelOperator_Bold_8_glyph_70[] = { 6, 7, 8, 1, 7, 255, 12, 60, 195, 12, 0 }; +/* G */ static const uint8_t Font_PixelOperator_Bold_8_glyph_71[] = { 6, 7, 8, 1, 7, 123, 60, 55, 207, 55, 192 }; +/* H */ static const uint8_t Font_PixelOperator_Bold_8_glyph_72[] = { 6, 7, 8, 1, 7, 207, 60, 255, 207, 60, 192 }; +/* I */ static const uint8_t Font_PixelOperator_Bold_8_glyph_73[] = { 2, 7, 6, 2, 7, 255, 252 }; +/* J */ static const uint8_t Font_PixelOperator_Bold_8_glyph_74[] = { 6, 7, 8, 1, 7, 12, 48, 195, 15, 55, 128 }; +/* K */ static const uint8_t Font_PixelOperator_Bold_8_glyph_75[] = { 6, 7, 8, 1, 7, 207, 111, 56, 243, 108, 192 }; +/* L */ static const uint8_t Font_PixelOperator_Bold_8_glyph_76[] = { 6, 7, 8, 1, 7, 195, 12, 48, 195, 15, 192 }; +/* M */ static const uint8_t Font_PixelOperator_Bold_8_glyph_77[] = { 7, 7, 9, 1, 7, 199, 143, 191, 253, 120, 241, 128 }; +/* N */ static const uint8_t Font_PixelOperator_Bold_8_glyph_78[] = { 6, 7, 8, 1, 7, 207, 62, 255, 223, 60, 192 }; +/* O */ static const uint8_t Font_PixelOperator_Bold_8_glyph_79[] = { 6, 7, 8, 1, 7, 123, 60, 243, 207, 55, 128 }; +/* P */ static const uint8_t Font_PixelOperator_Bold_8_glyph_80[] = { 6, 7, 8, 1, 7, 251, 60, 243, 251, 12, 0 }; +/* Q */ static const uint8_t Font_PixelOperator_Bold_8_glyph_81[] = { 6, 7, 8, 1, 7, 123, 60, 251, 255, 102, 192 }; +/* R */ static const uint8_t Font_PixelOperator_Bold_8_glyph_82[] = { 6, 7, 8, 1, 7, 251, 60, 243, 251, 108, 192 }; +/* S */ static const uint8_t Font_PixelOperator_Bold_8_glyph_83[] = { 6, 7, 8, 1, 7, 123, 60, 30, 15, 55, 128 }; +/* T */ static const uint8_t Font_PixelOperator_Bold_8_glyph_84[] = { 6, 7, 8, 1, 7, 252, 195, 12, 48, 195, 0 }; +/* U */ static const uint8_t Font_PixelOperator_Bold_8_glyph_85[] = { 6, 7, 8, 1, 7, 207, 60, 243, 207, 55, 128 }; +/* V */ static const uint8_t Font_PixelOperator_Bold_8_glyph_86[] = { 6, 7, 8, 1, 7, 207, 60, 243, 205, 227, 0 }; +/* W */ static const uint8_t Font_PixelOperator_Bold_8_glyph_87[] = { 7, 7, 9, 1, 7, 199, 143, 94, 189, 122, 219, 0 }; +/* X */ static const uint8_t Font_PixelOperator_Bold_8_glyph_88[] = { 6, 7, 8, 1, 7, 207, 55, 140, 123, 60, 192 }; +/* Y */ static const uint8_t Font_PixelOperator_Bold_8_glyph_89[] = { 6, 7, 8, 1, 7, 207, 55, 140, 48, 195, 0 }; +/* Z */ static const uint8_t Font_PixelOperator_Bold_8_glyph_90[] = { 6, 7, 8, 1, 7, 252, 49, 140, 99, 15, 192 }; +/* [ */ static const uint8_t Font_PixelOperator_Bold_8_glyph_91[] = { 4, 7, 8, 3, 7, 252, 204, 204, 240 }; +/* \ */ static const uint8_t Font_PixelOperator_Bold_8_glyph_92[] = { 4, 7, 6, 1, 7, 204, 102, 99, 48 }; +/* ] */ static const uint8_t Font_PixelOperator_Bold_8_glyph_93[] = { 4, 7, 7, 1, 7, 243, 51, 51, 240 }; +/* ^ */ static const uint8_t Font_PixelOperator_Bold_8_glyph_94[] = { 6, 4, 8, 1, 7, 49, 236, 225, 0 }; +/* _ */ static const uint8_t Font_PixelOperator_Bold_8_glyph_95[] = { 5, 1, 5, 0, 0, 248 }; +/* ` */ static const uint8_t Font_PixelOperator_Bold_8_glyph_96[] = { 3, 2, 6, 1, 7, 204 }; +/* a */ static const uint8_t Font_PixelOperator_Bold_8_glyph_97[] = { 6, 5, 8, 1, 5, 120, 55, 243, 124 }; +/* b */ static const uint8_t Font_PixelOperator_Bold_8_glyph_98[] = { 6, 7, 8, 1, 7, 195, 15, 179, 207, 63, 128 }; +/* c */ static const uint8_t Font_PixelOperator_Bold_8_glyph_99[] = { 6, 5, 8, 1, 5, 123, 60, 51, 120 }; +/* d */ static const uint8_t Font_PixelOperator_Bold_8_glyph_100[] = { 6, 7, 8, 1, 7, 12, 55, 243, 207, 55, 192 }; +/* e */ static const uint8_t Font_PixelOperator_Bold_8_glyph_101[] = { 6, 5, 8, 1, 5, 123, 63, 240, 120 }; +/* f */ static const uint8_t Font_PixelOperator_Bold_8_glyph_102[] = { 5, 7, 7, 1, 7, 59, 62, 198, 49, 128 }; +/* g */ static const uint8_t Font_PixelOperator_Bold_8_glyph_103[] = { 6, 6, 8, 1, 5, 127, 60, 223, 13, 224 }; +/* h */ static const uint8_t Font_PixelOperator_Bold_8_glyph_104[] = { 6, 7, 8, 1, 7, 195, 15, 179, 207, 60, 192 }; +/* i */ static const uint8_t Font_PixelOperator_Bold_8_glyph_105[] = { 2, 7, 6, 2, 7, 207, 252 }; +/* j */ static const uint8_t Font_PixelOperator_Bold_8_glyph_106[] = { 6, 8, 8, 1, 7, 12, 0, 195, 12, 60, 222, 0 }; +/* k */ static const uint8_t Font_PixelOperator_Bold_8_glyph_107[] = { 6, 7, 8, 1, 7, 195, 13, 188, 243, 108, 192 }; +/* l */ static const uint8_t Font_PixelOperator_Bold_8_glyph_108[] = { 3, 7, 6, 2, 7, 219, 109, 152 }; +/* m */ static const uint8_t Font_PixelOperator_Bold_8_glyph_109[] = { 7, 5, 9, 1, 5, 237, 175, 94, 60, 96 }; +/* n */ static const uint8_t Font_PixelOperator_Bold_8_glyph_110[] = { 6, 5, 8, 1, 5, 251, 60, 243, 204 }; +/* o */ static const uint8_t Font_PixelOperator_Bold_8_glyph_111[] = { 6, 5, 8, 1, 5, 123, 60, 243, 120 }; +/* p */ static const uint8_t Font_PixelOperator_Bold_8_glyph_112[] = { 6, 6, 8, 1, 5, 251, 60, 254, 195, 0 }; +/* q */ static const uint8_t Font_PixelOperator_Bold_8_glyph_113[] = { 6, 6, 8, 1, 5, 127, 60, 223, 12, 48 }; +/* r */ static const uint8_t Font_PixelOperator_Bold_8_glyph_114[] = { 6, 5, 8, 1, 5, 207, 126, 48, 192 }; +/* s */ static const uint8_t Font_PixelOperator_Bold_8_glyph_115[] = { 6, 5, 8, 1, 5, 123, 7, 131, 248 }; +/* t */ static const uint8_t Font_PixelOperator_Bold_8_glyph_116[] = { 5, 6, 7, 1, 6, 103, 216, 198, 28 }; +/* u */ static const uint8_t Font_PixelOperator_Bold_8_glyph_117[] = { 6, 5, 8, 1, 5, 207, 60, 243, 120 }; +/* v */ static const uint8_t Font_PixelOperator_Bold_8_glyph_118[] = { 6, 5, 8, 1, 5, 207, 60, 222, 48 }; +/* w */ static const uint8_t Font_PixelOperator_Bold_8_glyph_119[] = { 7, 5, 9, 1, 5, 199, 143, 94, 182, 192 }; +/* x */ static const uint8_t Font_PixelOperator_Bold_8_glyph_120[] = { 6, 5, 8, 1, 5, 205, 227, 30, 204 }; +/* y */ static const uint8_t Font_PixelOperator_Bold_8_glyph_121[] = { 6, 6, 8, 1, 5, 207, 60, 223, 13, 224 }; +/* z */ static const uint8_t Font_PixelOperator_Bold_8_glyph_122[] = { 6, 5, 8, 1, 5, 252, 99, 24, 252 }; +/* { */ static const uint8_t Font_PixelOperator_Bold_8_glyph_123[] = { 5, 7, 7, 1, 7, 59, 25, 134, 48, 224 }; +/* | */ static const uint8_t Font_PixelOperator_Bold_8_glyph_124[] = { 2, 7, 6, 2, 7, 255, 252 }; +/* } */ static const uint8_t Font_PixelOperator_Bold_8_glyph_125[] = { 5, 7, 7, 1, 7, 225, 140, 51, 27, 128 }; +/* ~ */ static const uint8_t Font_PixelOperator_Bold_8_glyph_126[] = { 7, 2, 9, 1, 7, 119, 184 }; + +const uint8_t Font_PixelOperator_Bold_8_glyph_nonprintable[] = { 6, 7, 8, 1, 7, 132, 207, 57, 207, 252, 255 }; + +const uint8_t * const Font_PixelOperator_Bold_8[126 + 1 - 32] = { + Font_PixelOperator_Bold_8_glyph_32, + Font_PixelOperator_Bold_8_glyph_33, + Font_PixelOperator_Bold_8_glyph_34, + Font_PixelOperator_Bold_8_glyph_35, + Font_PixelOperator_Bold_8_glyph_36, + Font_PixelOperator_Bold_8_glyph_37, + Font_PixelOperator_Bold_8_glyph_38, + Font_PixelOperator_Bold_8_glyph_39, + Font_PixelOperator_Bold_8_glyph_40, + Font_PixelOperator_Bold_8_glyph_41, + Font_PixelOperator_Bold_8_glyph_42, + Font_PixelOperator_Bold_8_glyph_43, + Font_PixelOperator_Bold_8_glyph_44, + Font_PixelOperator_Bold_8_glyph_45, + Font_PixelOperator_Bold_8_glyph_46, + Font_PixelOperator_Bold_8_glyph_47, + Font_PixelOperator_Bold_8_glyph_48, + Font_PixelOperator_Bold_8_glyph_49, + Font_PixelOperator_Bold_8_glyph_50, + Font_PixelOperator_Bold_8_glyph_51, + Font_PixelOperator_Bold_8_glyph_52, + Font_PixelOperator_Bold_8_glyph_53, + Font_PixelOperator_Bold_8_glyph_54, + Font_PixelOperator_Bold_8_glyph_55, + Font_PixelOperator_Bold_8_glyph_56, + Font_PixelOperator_Bold_8_glyph_57, + Font_PixelOperator_Bold_8_glyph_58, + Font_PixelOperator_Bold_8_glyph_59, + Font_PixelOperator_Bold_8_glyph_60, + Font_PixelOperator_Bold_8_glyph_61, + Font_PixelOperator_Bold_8_glyph_62, + Font_PixelOperator_Bold_8_glyph_63, + Font_PixelOperator_Bold_8_glyph_64, + Font_PixelOperator_Bold_8_glyph_65, + Font_PixelOperator_Bold_8_glyph_66, + Font_PixelOperator_Bold_8_glyph_67, + Font_PixelOperator_Bold_8_glyph_68, + Font_PixelOperator_Bold_8_glyph_69, + Font_PixelOperator_Bold_8_glyph_70, + Font_PixelOperator_Bold_8_glyph_71, + Font_PixelOperator_Bold_8_glyph_72, + Font_PixelOperator_Bold_8_glyph_73, + Font_PixelOperator_Bold_8_glyph_74, + Font_PixelOperator_Bold_8_glyph_75, + Font_PixelOperator_Bold_8_glyph_76, + Font_PixelOperator_Bold_8_glyph_77, + Font_PixelOperator_Bold_8_glyph_78, + Font_PixelOperator_Bold_8_glyph_79, + Font_PixelOperator_Bold_8_glyph_80, + Font_PixelOperator_Bold_8_glyph_81, + Font_PixelOperator_Bold_8_glyph_82, + Font_PixelOperator_Bold_8_glyph_83, + Font_PixelOperator_Bold_8_glyph_84, + Font_PixelOperator_Bold_8_glyph_85, + Font_PixelOperator_Bold_8_glyph_86, + Font_PixelOperator_Bold_8_glyph_87, + Font_PixelOperator_Bold_8_glyph_88, + Font_PixelOperator_Bold_8_glyph_89, + Font_PixelOperator_Bold_8_glyph_90, + Font_PixelOperator_Bold_8_glyph_91, + Font_PixelOperator_Bold_8_glyph_92, + Font_PixelOperator_Bold_8_glyph_93, + Font_PixelOperator_Bold_8_glyph_94, + Font_PixelOperator_Bold_8_glyph_95, + Font_PixelOperator_Bold_8_glyph_96, + Font_PixelOperator_Bold_8_glyph_97, + Font_PixelOperator_Bold_8_glyph_98, + Font_PixelOperator_Bold_8_glyph_99, + Font_PixelOperator_Bold_8_glyph_100, + Font_PixelOperator_Bold_8_glyph_101, + Font_PixelOperator_Bold_8_glyph_102, + Font_PixelOperator_Bold_8_glyph_103, + Font_PixelOperator_Bold_8_glyph_104, + Font_PixelOperator_Bold_8_glyph_105, + Font_PixelOperator_Bold_8_glyph_106, + Font_PixelOperator_Bold_8_glyph_107, + Font_PixelOperator_Bold_8_glyph_108, + Font_PixelOperator_Bold_8_glyph_109, + Font_PixelOperator_Bold_8_glyph_110, + Font_PixelOperator_Bold_8_glyph_111, + Font_PixelOperator_Bold_8_glyph_112, + Font_PixelOperator_Bold_8_glyph_113, + Font_PixelOperator_Bold_8_glyph_114, + Font_PixelOperator_Bold_8_glyph_115, + Font_PixelOperator_Bold_8_glyph_116, + Font_PixelOperator_Bold_8_glyph_117, + Font_PixelOperator_Bold_8_glyph_118, + Font_PixelOperator_Bold_8_glyph_119, + Font_PixelOperator_Bold_8_glyph_120, + Font_PixelOperator_Bold_8_glyph_121, + Font_PixelOperator_Bold_8_glyph_122, + Font_PixelOperator_Bold_8_glyph_123, + Font_PixelOperator_Bold_8_glyph_124, + Font_PixelOperator_Bold_8_glyph_125, + Font_PixelOperator_Bold_8_glyph_126, +}; diff --git a/core/embed/extmod/modtrezorui/font_pixeloperator_bold_8.h b/core/embed/extmod/modtrezorui/font_pixeloperator_bold_8.h new file mode 100644 index 000000000..ce3f12181 --- /dev/null +++ b/core/embed/extmod/modtrezorui/font_pixeloperator_bold_8.h @@ -0,0 +1,7 @@ +#include + +#if TREZOR_FONT_BPP != 1 +#error Wrong TREZOR_FONT_BPP (expected 1) +#endif +extern const uint8_t* const Font_PixelOperator_Bold_8[126 + 1 - 32]; +extern const uint8_t Font_PixelOperator_Bold_8_glyph_nonprintable[]; diff --git a/core/embed/extmod/modtrezorui/font_pixeloperator_regular_8.c b/core/embed/extmod/modtrezorui/font_pixeloperator_regular_8.c new file mode 100644 index 000000000..791e7ddee --- /dev/null +++ b/core/embed/extmod/modtrezorui/font_pixeloperator_regular_8.c @@ -0,0 +1,204 @@ +#include + +// first two bytes are width and height of the glyph +// third, fourth and fifth bytes are advance +// bearingX and bearingY of the horizontal metrics of the glyph +// rest is packed 4-bit glyph data + +// clang-format off + +/* */ static const uint8_t Font_PixelOperator_Regular_8_glyph_32[] = { 0, 0, 4, 0, 0 }; +/* ! */ static const uint8_t Font_PixelOperator_Regular_8_glyph_33[] = { 1, 7, 5, 2, 7, 250 }; +/* " */ static const uint8_t Font_PixelOperator_Regular_8_glyph_34[] = { 3, 3, 7, 2, 7, 182, 128 }; +/* # */ static const uint8_t Font_PixelOperator_Regular_8_glyph_35[] = { 6, 6, 8, 1, 6, 75, 244, 146, 253, 32 }; +/* $ */ static const uint8_t Font_PixelOperator_Regular_8_glyph_36[] = { 5, 7, 7, 1, 7, 35, 168, 226, 248, 128 }; +/* % */ static const uint8_t Font_PixelOperator_Regular_8_glyph_37[] = { 7, 7, 9, 1, 7, 65, 74, 162, 162, 169, 65, 0 }; +/* & */ static const uint8_t Font_PixelOperator_Regular_8_glyph_38[] = { 5, 7, 7, 1, 7, 116, 96, 232, 197, 224 }; +/* ' */ static const uint8_t Font_PixelOperator_Regular_8_glyph_39[] = { 1, 3, 5, 2, 7, 224 }; +/* ( */ static const uint8_t Font_PixelOperator_Regular_8_glyph_40[] = { 3, 7, 7, 3, 7, 42, 72, 136 }; +/* ) */ static const uint8_t Font_PixelOperator_Regular_8_glyph_41[] = { 3, 7, 7, 1, 7, 136, 146, 160 }; +/* * */ static const uint8_t Font_PixelOperator_Regular_8_glyph_42[] = { 5, 5, 7, 1, 7, 37, 93, 82, 0 }; +/* + */ static const uint8_t Font_PixelOperator_Regular_8_glyph_43[] = { 5, 5, 7, 1, 6, 33, 62, 66, 0 }; +/* , */ static const uint8_t Font_PixelOperator_Regular_8_glyph_44[] = { 2, 3, 5, 1, 2, 88 }; +/* - */ static const uint8_t Font_PixelOperator_Regular_8_glyph_45[] = { 4, 1, 6, 1, 4, 240 }; +/* . */ static const uint8_t Font_PixelOperator_Regular_8_glyph_46[] = { 1, 1, 5, 2, 1, 128 }; +/* / */ static const uint8_t Font_PixelOperator_Regular_8_glyph_47[] = { 3, 7, 5, 1, 7, 37, 37, 32 }; +/* 0 */ static const uint8_t Font_PixelOperator_Regular_8_glyph_48[] = { 5, 7, 7, 1, 7, 116, 103, 92, 197, 192 }; +/* 1 */ static const uint8_t Font_PixelOperator_Regular_8_glyph_49[] = { 3, 7, 7, 2, 7, 46, 146, 72 }; +/* 2 */ static const uint8_t Font_PixelOperator_Regular_8_glyph_50[] = { 5, 7, 7, 1, 7, 116, 66, 34, 35, 224 }; +/* 3 */ static const uint8_t Font_PixelOperator_Regular_8_glyph_51[] = { 5, 7, 7, 1, 7, 116, 66, 96, 197, 192 }; +/* 4 */ static const uint8_t Font_PixelOperator_Regular_8_glyph_52[] = { 5, 7, 7, 1, 7, 25, 83, 31, 132, 32 }; +/* 5 */ static const uint8_t Font_PixelOperator_Regular_8_glyph_53[] = { 5, 7, 7, 1, 7, 252, 60, 16, 197, 192 }; +/* 6 */ static const uint8_t Font_PixelOperator_Regular_8_glyph_54[] = { 5, 7, 7, 1, 7, 116, 97, 232, 197, 192 }; +/* 7 */ static const uint8_t Font_PixelOperator_Regular_8_glyph_55[] = { 5, 7, 7, 1, 7, 248, 68, 68, 66, 0 }; +/* 8 */ static const uint8_t Font_PixelOperator_Regular_8_glyph_56[] = { 5, 7, 7, 1, 7, 116, 98, 232, 197, 192 }; +/* 9 */ static const uint8_t Font_PixelOperator_Regular_8_glyph_57[] = { 5, 7, 7, 1, 7, 116, 98, 240, 197, 192 }; +/* : */ static const uint8_t Font_PixelOperator_Regular_8_glyph_58[] = { 1, 5, 5, 2, 5, 136 }; +/* ; */ static const uint8_t Font_PixelOperator_Regular_8_glyph_59[] = { 2, 6, 5, 1, 5, 65, 96 }; +/* < */ static const uint8_t Font_PixelOperator_Regular_8_glyph_60[] = { 3, 5, 5, 1, 6, 42, 34 }; +/* = */ static const uint8_t Font_PixelOperator_Regular_8_glyph_61[] = { 4, 3, 6, 1, 5, 240, 240 }; +/* > */ static const uint8_t Font_PixelOperator_Regular_8_glyph_62[] = { 3, 5, 5, 1, 6, 136, 168 }; +/* ? */ static const uint8_t Font_PixelOperator_Regular_8_glyph_63[] = { 5, 7, 7, 1, 7, 116, 66, 34, 0, 128 }; +/* @ */ static const uint8_t Font_PixelOperator_Regular_8_glyph_64[] = { 7, 8, 9, 1, 7, 125, 6, 109, 90, 179, 160, 62, 0 }; +/* A */ static const uint8_t Font_PixelOperator_Regular_8_glyph_65[] = { 5, 7, 7, 1, 7, 116, 99, 31, 198, 32 }; +/* B */ static const uint8_t Font_PixelOperator_Regular_8_glyph_66[] = { 5, 7, 7, 1, 7, 244, 99, 232, 199, 192 }; +/* C */ static const uint8_t Font_PixelOperator_Regular_8_glyph_67[] = { 5, 7, 7, 1, 7, 116, 97, 8, 69, 192 }; +/* D */ static const uint8_t Font_PixelOperator_Regular_8_glyph_68[] = { 5, 7, 7, 1, 7, 244, 99, 24, 199, 192 }; +/* E */ static const uint8_t Font_PixelOperator_Regular_8_glyph_69[] = { 5, 7, 7, 1, 7, 252, 33, 200, 67, 224 }; +/* F */ static const uint8_t Font_PixelOperator_Regular_8_glyph_70[] = { 5, 7, 7, 1, 7, 252, 33, 200, 66, 0 }; +/* G */ static const uint8_t Font_PixelOperator_Regular_8_glyph_71[] = { 5, 7, 7, 1, 7, 116, 97, 56, 197, 224 }; +/* H */ static const uint8_t Font_PixelOperator_Regular_8_glyph_72[] = { 5, 7, 7, 1, 7, 140, 99, 248, 198, 32 }; +/* I */ static const uint8_t Font_PixelOperator_Regular_8_glyph_73[] = { 1, 7, 5, 2, 7, 254 }; +/* J */ static const uint8_t Font_PixelOperator_Regular_8_glyph_74[] = { 5, 7, 7, 1, 7, 8, 66, 16, 197, 192 }; +/* K */ static const uint8_t Font_PixelOperator_Regular_8_glyph_75[] = { 5, 7, 7, 1, 7, 140, 169, 138, 74, 32 }; +/* L */ static const uint8_t Font_PixelOperator_Regular_8_glyph_76[] = { 5, 7, 7, 1, 7, 132, 33, 8, 67, 224 }; +/* M */ static const uint8_t Font_PixelOperator_Regular_8_glyph_77[] = { 7, 7, 9, 1, 7, 131, 7, 29, 89, 48, 96, 128 }; +/* N */ static const uint8_t Font_PixelOperator_Regular_8_glyph_78[] = { 5, 7, 7, 1, 7, 140, 115, 89, 198, 32 }; +/* O */ static const uint8_t Font_PixelOperator_Regular_8_glyph_79[] = { 5, 7, 7, 1, 7, 116, 99, 24, 197, 192 }; +/* P */ static const uint8_t Font_PixelOperator_Regular_8_glyph_80[] = { 5, 7, 7, 1, 7, 244, 99, 31, 66, 0 }; +/* Q */ static const uint8_t Font_PixelOperator_Regular_8_glyph_81[] = { 5, 7, 7, 1, 7, 116, 99, 26, 201, 160 }; +/* R */ static const uint8_t Font_PixelOperator_Regular_8_glyph_82[] = { 5, 7, 7, 1, 7, 244, 99, 31, 74, 32 }; +/* S */ static const uint8_t Font_PixelOperator_Regular_8_glyph_83[] = { 5, 7, 7, 1, 7, 116, 96, 224, 197, 192 }; +/* T */ static const uint8_t Font_PixelOperator_Regular_8_glyph_84[] = { 5, 7, 7, 1, 7, 249, 8, 66, 16, 128 }; +/* U */ static const uint8_t Font_PixelOperator_Regular_8_glyph_85[] = { 5, 7, 7, 1, 7, 140, 99, 24, 197, 192 }; +/* V */ static const uint8_t Font_PixelOperator_Regular_8_glyph_86[] = { 5, 7, 7, 1, 7, 140, 99, 24, 168, 128 }; +/* W */ static const uint8_t Font_PixelOperator_Regular_8_glyph_87[] = { 7, 7, 9, 1, 7, 131, 6, 76, 153, 50, 91, 0 }; +/* X */ static const uint8_t Font_PixelOperator_Regular_8_glyph_88[] = { 5, 7, 7, 1, 7, 140, 84, 69, 70, 32 }; +/* Y */ static const uint8_t Font_PixelOperator_Regular_8_glyph_89[] = { 5, 7, 7, 1, 7, 140, 84, 66, 16, 128 }; +/* Z */ static const uint8_t Font_PixelOperator_Regular_8_glyph_90[] = { 5, 7, 7, 1, 7, 248, 68, 68, 67, 224 }; +/* [ */ static const uint8_t Font_PixelOperator_Regular_8_glyph_91[] = { 3, 7, 7, 3, 7, 242, 73, 56 }; +/* \ */ static const uint8_t Font_PixelOperator_Regular_8_glyph_92[] = { 3, 7, 5, 1, 7, 145, 36, 72 }; +/* ] */ static const uint8_t Font_PixelOperator_Regular_8_glyph_93[] = { 3, 7, 7, 1, 7, 228, 146, 120 }; +/* ^ */ static const uint8_t Font_PixelOperator_Regular_8_glyph_94[] = { 5, 3, 7, 1, 7, 34, 162 }; +/* _ */ static const uint8_t Font_PixelOperator_Regular_8_glyph_95[] = { 5, 1, 5, 0, 0, 248 }; +/* ` */ static const uint8_t Font_PixelOperator_Regular_8_glyph_96[] = { 2, 2, 5, 1, 7, 144 }; +/* a */ static const uint8_t Font_PixelOperator_Regular_8_glyph_97[] = { 5, 5, 7, 1, 5, 112, 95, 23, 128 }; +/* b */ static const uint8_t Font_PixelOperator_Regular_8_glyph_98[] = { 5, 7, 7, 1, 7, 132, 61, 24, 199, 192 }; +/* c */ static const uint8_t Font_PixelOperator_Regular_8_glyph_99[] = { 5, 5, 7, 1, 5, 116, 97, 23, 0 }; +/* d */ static const uint8_t Font_PixelOperator_Regular_8_glyph_100[] = { 5, 7, 7, 1, 7, 8, 95, 24, 197, 224 }; +/* e */ static const uint8_t Font_PixelOperator_Regular_8_glyph_101[] = { 5, 5, 7, 1, 5, 116, 127, 7, 0 }; +/* f */ static const uint8_t Font_PixelOperator_Regular_8_glyph_102[] = { 4, 7, 6, 1, 7, 52, 244, 68, 64 }; +/* g */ static const uint8_t Font_PixelOperator_Regular_8_glyph_103[] = { 5, 6, 7, 1, 5, 124, 98, 240, 184 }; +/* h */ static const uint8_t Font_PixelOperator_Regular_8_glyph_104[] = { 5, 7, 7, 1, 7, 132, 61, 24, 198, 32 }; +/* i */ static const uint8_t Font_PixelOperator_Regular_8_glyph_105[] = { 1, 7, 5, 2, 7, 190 }; +/* j */ static const uint8_t Font_PixelOperator_Regular_8_glyph_106[] = { 5, 8, 7, 1, 7, 8, 2, 16, 134, 46, 0 }; +/* k */ static const uint8_t Font_PixelOperator_Regular_8_glyph_107[] = { 5, 7, 7, 1, 7, 132, 37, 78, 74, 32 }; +/* l */ static const uint8_t Font_PixelOperator_Regular_8_glyph_108[] = { 2, 7, 5, 2, 7, 170, 164 }; +/* m */ static const uint8_t Font_PixelOperator_Regular_8_glyph_109[] = { 7, 5, 9, 1, 5, 237, 38, 76, 24, 32 }; +/* n */ static const uint8_t Font_PixelOperator_Regular_8_glyph_110[] = { 5, 5, 7, 1, 5, 244, 99, 24, 128 }; +/* o */ static const uint8_t Font_PixelOperator_Regular_8_glyph_111[] = { 5, 5, 7, 1, 5, 116, 99, 23, 0 }; +/* p */ static const uint8_t Font_PixelOperator_Regular_8_glyph_112[] = { 5, 6, 7, 1, 5, 244, 99, 232, 64 }; +/* q */ static const uint8_t Font_PixelOperator_Regular_8_glyph_113[] = { 5, 6, 7, 1, 5, 124, 98, 240, 132 }; +/* r */ static const uint8_t Font_PixelOperator_Regular_8_glyph_114[] = { 5, 5, 7, 1, 5, 157, 49, 8, 0 }; +/* s */ static const uint8_t Font_PixelOperator_Regular_8_glyph_115[] = { 5, 5, 7, 1, 5, 116, 28, 31, 0 }; +/* t */ static const uint8_t Font_PixelOperator_Regular_8_glyph_116[] = { 4, 6, 6, 1, 6, 79, 68, 67, 0 }; +/* u */ static const uint8_t Font_PixelOperator_Regular_8_glyph_117[] = { 5, 5, 7, 1, 5, 140, 99, 23, 0 }; +/* v */ static const uint8_t Font_PixelOperator_Regular_8_glyph_118[] = { 5, 5, 7, 1, 5, 140, 98, 162, 0 }; +/* w */ static const uint8_t Font_PixelOperator_Regular_8_glyph_119[] = { 7, 5, 9, 1, 5, 131, 6, 76, 150, 192 }; +/* x */ static const uint8_t Font_PixelOperator_Regular_8_glyph_120[] = { 5, 5, 7, 1, 5, 138, 136, 168, 128 }; +/* y */ static const uint8_t Font_PixelOperator_Regular_8_glyph_121[] = { 5, 6, 7, 1, 5, 140, 98, 240, 184 }; +/* z */ static const uint8_t Font_PixelOperator_Regular_8_glyph_122[] = { 5, 5, 7, 1, 5, 248, 136, 143, 128 }; +/* { */ static const uint8_t Font_PixelOperator_Regular_8_glyph_123[] = { 4, 7, 7, 2, 7, 52, 72, 68, 48 }; +/* | */ static const uint8_t Font_PixelOperator_Regular_8_glyph_124[] = { 1, 7, 5, 2, 7, 254 }; +/* } */ static const uint8_t Font_PixelOperator_Regular_8_glyph_125[] = { 4, 7, 7, 1, 7, 194, 33, 34, 192 }; +/* ~ */ static const uint8_t Font_PixelOperator_Regular_8_glyph_126[] = { 6, 2, 8, 1, 7, 102, 96 }; + +const uint8_t Font_PixelOperator_Regular_8_glyph_nonprintable[] = { 5, 7, 7, 1, 7, 139, 189, 221, 255, 127 }; + +const uint8_t * const Font_PixelOperator_Regular_8[126 + 1 - 32] = { + Font_PixelOperator_Regular_8_glyph_32, + Font_PixelOperator_Regular_8_glyph_33, + Font_PixelOperator_Regular_8_glyph_34, + Font_PixelOperator_Regular_8_glyph_35, + Font_PixelOperator_Regular_8_glyph_36, + Font_PixelOperator_Regular_8_glyph_37, + Font_PixelOperator_Regular_8_glyph_38, + Font_PixelOperator_Regular_8_glyph_39, + Font_PixelOperator_Regular_8_glyph_40, + Font_PixelOperator_Regular_8_glyph_41, + Font_PixelOperator_Regular_8_glyph_42, + Font_PixelOperator_Regular_8_glyph_43, + Font_PixelOperator_Regular_8_glyph_44, + Font_PixelOperator_Regular_8_glyph_45, + Font_PixelOperator_Regular_8_glyph_46, + Font_PixelOperator_Regular_8_glyph_47, + Font_PixelOperator_Regular_8_glyph_48, + Font_PixelOperator_Regular_8_glyph_49, + Font_PixelOperator_Regular_8_glyph_50, + Font_PixelOperator_Regular_8_glyph_51, + Font_PixelOperator_Regular_8_glyph_52, + Font_PixelOperator_Regular_8_glyph_53, + Font_PixelOperator_Regular_8_glyph_54, + Font_PixelOperator_Regular_8_glyph_55, + Font_PixelOperator_Regular_8_glyph_56, + Font_PixelOperator_Regular_8_glyph_57, + Font_PixelOperator_Regular_8_glyph_58, + Font_PixelOperator_Regular_8_glyph_59, + Font_PixelOperator_Regular_8_glyph_60, + Font_PixelOperator_Regular_8_glyph_61, + Font_PixelOperator_Regular_8_glyph_62, + Font_PixelOperator_Regular_8_glyph_63, + Font_PixelOperator_Regular_8_glyph_64, + Font_PixelOperator_Regular_8_glyph_65, + Font_PixelOperator_Regular_8_glyph_66, + Font_PixelOperator_Regular_8_glyph_67, + Font_PixelOperator_Regular_8_glyph_68, + Font_PixelOperator_Regular_8_glyph_69, + Font_PixelOperator_Regular_8_glyph_70, + Font_PixelOperator_Regular_8_glyph_71, + Font_PixelOperator_Regular_8_glyph_72, + Font_PixelOperator_Regular_8_glyph_73, + Font_PixelOperator_Regular_8_glyph_74, + Font_PixelOperator_Regular_8_glyph_75, + Font_PixelOperator_Regular_8_glyph_76, + Font_PixelOperator_Regular_8_glyph_77, + Font_PixelOperator_Regular_8_glyph_78, + Font_PixelOperator_Regular_8_glyph_79, + Font_PixelOperator_Regular_8_glyph_80, + Font_PixelOperator_Regular_8_glyph_81, + Font_PixelOperator_Regular_8_glyph_82, + Font_PixelOperator_Regular_8_glyph_83, + Font_PixelOperator_Regular_8_glyph_84, + Font_PixelOperator_Regular_8_glyph_85, + Font_PixelOperator_Regular_8_glyph_86, + Font_PixelOperator_Regular_8_glyph_87, + Font_PixelOperator_Regular_8_glyph_88, + Font_PixelOperator_Regular_8_glyph_89, + Font_PixelOperator_Regular_8_glyph_90, + Font_PixelOperator_Regular_8_glyph_91, + Font_PixelOperator_Regular_8_glyph_92, + Font_PixelOperator_Regular_8_glyph_93, + Font_PixelOperator_Regular_8_glyph_94, + Font_PixelOperator_Regular_8_glyph_95, + Font_PixelOperator_Regular_8_glyph_96, + Font_PixelOperator_Regular_8_glyph_97, + Font_PixelOperator_Regular_8_glyph_98, + Font_PixelOperator_Regular_8_glyph_99, + Font_PixelOperator_Regular_8_glyph_100, + Font_PixelOperator_Regular_8_glyph_101, + Font_PixelOperator_Regular_8_glyph_102, + Font_PixelOperator_Regular_8_glyph_103, + Font_PixelOperator_Regular_8_glyph_104, + Font_PixelOperator_Regular_8_glyph_105, + Font_PixelOperator_Regular_8_glyph_106, + Font_PixelOperator_Regular_8_glyph_107, + Font_PixelOperator_Regular_8_glyph_108, + Font_PixelOperator_Regular_8_glyph_109, + Font_PixelOperator_Regular_8_glyph_110, + Font_PixelOperator_Regular_8_glyph_111, + Font_PixelOperator_Regular_8_glyph_112, + Font_PixelOperator_Regular_8_glyph_113, + Font_PixelOperator_Regular_8_glyph_114, + Font_PixelOperator_Regular_8_glyph_115, + Font_PixelOperator_Regular_8_glyph_116, + Font_PixelOperator_Regular_8_glyph_117, + Font_PixelOperator_Regular_8_glyph_118, + Font_PixelOperator_Regular_8_glyph_119, + Font_PixelOperator_Regular_8_glyph_120, + Font_PixelOperator_Regular_8_glyph_121, + Font_PixelOperator_Regular_8_glyph_122, + Font_PixelOperator_Regular_8_glyph_123, + Font_PixelOperator_Regular_8_glyph_124, + Font_PixelOperator_Regular_8_glyph_125, + Font_PixelOperator_Regular_8_glyph_126, +}; diff --git a/core/embed/extmod/modtrezorui/font_pixeloperator_regular_8.h b/core/embed/extmod/modtrezorui/font_pixeloperator_regular_8.h new file mode 100644 index 000000000..d7233cf5d --- /dev/null +++ b/core/embed/extmod/modtrezorui/font_pixeloperator_regular_8.h @@ -0,0 +1,7 @@ +#include + +#if TREZOR_FONT_BPP != 1 +#error Wrong TREZOR_FONT_BPP (expected 1) +#endif +extern const uint8_t* const Font_PixelOperator_Regular_8[126 + 1 - 32]; +extern const uint8_t Font_PixelOperator_Regular_8_glyph_nonprintable[]; diff --git a/core/embed/extmod/modtrezorui/font_pixeloperatormono_regular_8.c b/core/embed/extmod/modtrezorui/font_pixeloperatormono_regular_8.c new file mode 100644 index 000000000..f89846ee6 --- /dev/null +++ b/core/embed/extmod/modtrezorui/font_pixeloperatormono_regular_8.c @@ -0,0 +1,204 @@ +#include + +// first two bytes are width and height of the glyph +// third, fourth and fifth bytes are advance +// bearingX and bearingY of the horizontal metrics of the glyph +// rest is packed 4-bit glyph data + +// clang-format off + +/* */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_32[] = { 0, 0, 8, 0, 0 }; +/* ! */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_33[] = { 1, 7, 8, 3, 7, 250 }; +/* " */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_34[] = { 3, 3, 8, 2, 7, 182, 128 }; +/* # */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_35[] = { 6, 6, 8, 1, 6, 75, 244, 146, 253, 32 }; +/* $ */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_36[] = { 5, 7, 8, 1, 7, 35, 168, 226, 248, 128 }; +/* % */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_37[] = { 7, 7, 8, 0, 7, 65, 74, 162, 162, 169, 65, 0 }; +/* & */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_38[] = { 5, 7, 8, 1, 7, 116, 96, 232, 197, 224 }; +/* ' */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_39[] = { 1, 3, 8, 3, 7, 224 }; +/* ( */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_40[] = { 3, 7, 8, 3, 7, 42, 72, 136 }; +/* ) */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_41[] = { 3, 7, 8, 1, 7, 136, 146, 160 }; +/* * */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_42[] = { 5, 5, 8, 1, 7, 37, 93, 82, 0 }; +/* + */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_43[] = { 5, 5, 8, 1, 6, 33, 62, 66, 0 }; +/* , */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_44[] = { 2, 3, 8, 2, 2, 88 }; +/* - */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_45[] = { 4, 1, 8, 2, 4, 240 }; +/* . */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_46[] = { 1, 1, 8, 3, 1, 128 }; +/* / */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_47[] = { 3, 7, 8, 2, 7, 37, 37, 32 }; +/* 0 */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_48[] = { 5, 7, 8, 1, 7, 116, 103, 92, 197, 192 }; +/* 1 */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_49[] = { 5, 7, 8, 1, 7, 35, 40, 66, 19, 224 }; +/* 2 */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_50[] = { 5, 7, 8, 1, 7, 116, 66, 34, 35, 224 }; +/* 3 */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_51[] = { 5, 7, 8, 1, 7, 116, 66, 96, 197, 192 }; +/* 4 */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_52[] = { 5, 7, 8, 1, 7, 25, 83, 31, 132, 32 }; +/* 5 */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_53[] = { 5, 7, 8, 1, 7, 252, 60, 16, 197, 192 }; +/* 6 */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_54[] = { 5, 7, 8, 1, 7, 116, 97, 232, 197, 192 }; +/* 7 */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_55[] = { 5, 7, 8, 1, 7, 248, 68, 68, 66, 0 }; +/* 8 */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_56[] = { 5, 7, 8, 1, 7, 116, 98, 232, 197, 192 }; +/* 9 */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_57[] = { 5, 7, 8, 1, 7, 116, 98, 240, 197, 192 }; +/* : */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_58[] = { 1, 5, 8, 3, 5, 136 }; +/* ; */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_59[] = { 2, 6, 8, 2, 5, 65, 96 }; +/* < */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_60[] = { 3, 5, 8, 2, 6, 42, 34 }; +/* = */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_61[] = { 4, 3, 8, 2, 5, 240, 240 }; +/* > */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_62[] = { 3, 5, 8, 2, 6, 136, 168 }; +/* ? */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_63[] = { 5, 7, 8, 1, 7, 116, 66, 34, 0, 128 }; +/* @ */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_64[] = { 7, 8, 8, 0, 7, 125, 6, 109, 90, 179, 160, 62, 0 }; +/* A */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_65[] = { 5, 7, 8, 1, 7, 116, 99, 31, 198, 32 }; +/* B */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_66[] = { 5, 7, 8, 1, 7, 244, 99, 232, 199, 192 }; +/* C */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_67[] = { 5, 7, 8, 1, 7, 116, 97, 8, 69, 192 }; +/* D */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_68[] = { 5, 7, 8, 1, 7, 244, 99, 24, 199, 192 }; +/* E */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_69[] = { 5, 7, 8, 1, 7, 252, 33, 200, 67, 224 }; +/* F */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_70[] = { 5, 7, 8, 1, 7, 252, 33, 200, 66, 0 }; +/* G */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_71[] = { 5, 7, 8, 1, 7, 116, 97, 56, 197, 224 }; +/* H */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_72[] = { 5, 7, 8, 1, 7, 140, 99, 248, 198, 32 }; +/* I */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_73[] = { 5, 7, 8, 1, 7, 249, 8, 66, 19, 224 }; +/* J */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_74[] = { 6, 7, 8, 1, 7, 60, 32, 130, 10, 39, 0 }; +/* K */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_75[] = { 5, 7, 8, 1, 7, 140, 169, 138, 74, 32 }; +/* L */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_76[] = { 5, 7, 8, 1, 7, 132, 33, 8, 67, 224 }; +/* M */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_77[] = { 7, 7, 8, 0, 7, 131, 7, 29, 89, 48, 96, 128 }; +/* N */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_78[] = { 5, 7, 8, 1, 7, 140, 115, 89, 198, 32 }; +/* O */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_79[] = { 5, 7, 8, 1, 7, 116, 99, 24, 197, 192 }; +/* P */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_80[] = { 5, 7, 8, 1, 7, 244, 99, 31, 66, 0 }; +/* Q */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_81[] = { 5, 7, 8, 1, 7, 116, 99, 26, 201, 160 }; +/* R */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_82[] = { 5, 7, 8, 1, 7, 244, 99, 31, 74, 32 }; +/* S */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_83[] = { 5, 7, 8, 1, 7, 116, 96, 224, 197, 192 }; +/* T */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_84[] = { 5, 7, 8, 1, 7, 249, 8, 66, 16, 128 }; +/* U */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_85[] = { 5, 7, 8, 1, 7, 140, 99, 24, 197, 192 }; +/* V */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_86[] = { 5, 7, 8, 1, 7, 140, 99, 24, 168, 128 }; +/* W */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_87[] = { 7, 7, 8, 0, 7, 131, 6, 76, 153, 50, 91, 0 }; +/* X */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_88[] = { 5, 7, 8, 1, 7, 140, 84, 69, 70, 32 }; +/* Y */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_89[] = { 5, 7, 8, 1, 7, 140, 84, 66, 16, 128 }; +/* Z */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_90[] = { 5, 7, 8, 1, 7, 248, 68, 68, 67, 224 }; +/* [ */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_91[] = { 3, 7, 8, 3, 7, 242, 73, 56 }; +/* \ */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_92[] = { 3, 7, 8, 2, 7, 145, 36, 72 }; +/* ] */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_93[] = { 3, 7, 8, 1, 7, 228, 146, 120 }; +/* ^ */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_94[] = { 5, 3, 8, 1, 7, 34, 162 }; +/* _ */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_95[] = { 8, 1, 8, 0, 0, 255, 0 }; +/* ` */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_96[] = { 2, 2, 8, 2, 7, 144 }; +/* a */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_97[] = { 5, 5, 8, 1, 5, 112, 95, 23, 128 }; +/* b */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_98[] = { 5, 7, 8, 1, 7, 132, 61, 24, 199, 192 }; +/* c */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_99[] = { 5, 5, 8, 1, 5, 116, 97, 23, 0 }; +/* d */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_100[] = { 5, 7, 8, 1, 7, 8, 95, 24, 197, 224 }; +/* e */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_101[] = { 5, 5, 8, 1, 5, 116, 127, 7, 0 }; +/* f */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_102[] = { 4, 7, 8, 2, 7, 52, 244, 68, 64 }; +/* g */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_103[] = { 5, 6, 8, 1, 5, 124, 98, 240, 184 }; +/* h */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_104[] = { 5, 7, 8, 1, 7, 132, 61, 24, 198, 32 }; +/* i */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_105[] = { 5, 7, 8, 1, 7, 32, 56, 66, 19, 224 }; +/* j */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_106[] = { 5, 8, 8, 1, 7, 8, 14, 16, 134, 46, 0 }; +/* k */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_107[] = { 5, 7, 8, 1, 7, 132, 37, 78, 74, 32 }; +/* l */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_108[] = { 5, 7, 8, 1, 7, 225, 8, 66, 19, 224 }; +/* m */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_109[] = { 7, 5, 8, 0, 5, 237, 38, 76, 24, 32 }; +/* n */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_110[] = { 5, 5, 8, 1, 5, 244, 99, 24, 128 }; +/* o */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_111[] = { 5, 5, 8, 1, 5, 116, 99, 23, 0 }; +/* p */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_112[] = { 5, 6, 8, 1, 5, 244, 99, 232, 64 }; +/* q */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_113[] = { 5, 6, 8, 1, 5, 124, 98, 240, 132 }; +/* r */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_114[] = { 5, 5, 8, 1, 5, 157, 49, 8, 0 }; +/* s */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_115[] = { 5, 5, 8, 1, 5, 116, 28, 31, 0 }; +/* t */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_116[] = { 4, 6, 8, 2, 6, 79, 68, 67, 0 }; +/* u */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_117[] = { 5, 5, 8, 1, 5, 140, 99, 23, 0 }; +/* v */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_118[] = { 5, 5, 8, 1, 5, 140, 98, 162, 0 }; +/* w */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_119[] = { 7, 5, 8, 0, 5, 131, 6, 76, 150, 192 }; +/* x */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_120[] = { 5, 5, 8, 1, 5, 138, 136, 168, 128 }; +/* y */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_121[] = { 5, 6, 8, 1, 5, 140, 98, 240, 184 }; +/* z */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_122[] = { 5, 5, 8, 1, 5, 248, 136, 143, 128 }; +/* { */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_123[] = { 4, 7, 8, 2, 7, 52, 72, 68, 48 }; +/* | */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_124[] = { 1, 7, 8, 3, 7, 254 }; +/* } */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_125[] = { 4, 7, 8, 1, 7, 194, 33, 34, 192 }; +/* ~ */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_126[] = { 6, 2, 8, 1, 7, 102, 96 }; + +const uint8_t Font_PixelOperatorMono_Regular_8_glyph_nonprintable[] = { 5, 7, 8, 1, 7, 139, 189, 221, 255, 127 }; + +const uint8_t * const Font_PixelOperatorMono_Regular_8[126 + 1 - 32] = { + Font_PixelOperatorMono_Regular_8_glyph_32, + Font_PixelOperatorMono_Regular_8_glyph_33, + Font_PixelOperatorMono_Regular_8_glyph_34, + Font_PixelOperatorMono_Regular_8_glyph_35, + Font_PixelOperatorMono_Regular_8_glyph_36, + Font_PixelOperatorMono_Regular_8_glyph_37, + Font_PixelOperatorMono_Regular_8_glyph_38, + Font_PixelOperatorMono_Regular_8_glyph_39, + Font_PixelOperatorMono_Regular_8_glyph_40, + Font_PixelOperatorMono_Regular_8_glyph_41, + Font_PixelOperatorMono_Regular_8_glyph_42, + Font_PixelOperatorMono_Regular_8_glyph_43, + Font_PixelOperatorMono_Regular_8_glyph_44, + Font_PixelOperatorMono_Regular_8_glyph_45, + Font_PixelOperatorMono_Regular_8_glyph_46, + Font_PixelOperatorMono_Regular_8_glyph_47, + Font_PixelOperatorMono_Regular_8_glyph_48, + Font_PixelOperatorMono_Regular_8_glyph_49, + Font_PixelOperatorMono_Regular_8_glyph_50, + Font_PixelOperatorMono_Regular_8_glyph_51, + Font_PixelOperatorMono_Regular_8_glyph_52, + Font_PixelOperatorMono_Regular_8_glyph_53, + Font_PixelOperatorMono_Regular_8_glyph_54, + Font_PixelOperatorMono_Regular_8_glyph_55, + Font_PixelOperatorMono_Regular_8_glyph_56, + Font_PixelOperatorMono_Regular_8_glyph_57, + Font_PixelOperatorMono_Regular_8_glyph_58, + Font_PixelOperatorMono_Regular_8_glyph_59, + Font_PixelOperatorMono_Regular_8_glyph_60, + Font_PixelOperatorMono_Regular_8_glyph_61, + Font_PixelOperatorMono_Regular_8_glyph_62, + Font_PixelOperatorMono_Regular_8_glyph_63, + Font_PixelOperatorMono_Regular_8_glyph_64, + Font_PixelOperatorMono_Regular_8_glyph_65, + Font_PixelOperatorMono_Regular_8_glyph_66, + Font_PixelOperatorMono_Regular_8_glyph_67, + Font_PixelOperatorMono_Regular_8_glyph_68, + Font_PixelOperatorMono_Regular_8_glyph_69, + Font_PixelOperatorMono_Regular_8_glyph_70, + Font_PixelOperatorMono_Regular_8_glyph_71, + Font_PixelOperatorMono_Regular_8_glyph_72, + Font_PixelOperatorMono_Regular_8_glyph_73, + Font_PixelOperatorMono_Regular_8_glyph_74, + Font_PixelOperatorMono_Regular_8_glyph_75, + Font_PixelOperatorMono_Regular_8_glyph_76, + Font_PixelOperatorMono_Regular_8_glyph_77, + Font_PixelOperatorMono_Regular_8_glyph_78, + Font_PixelOperatorMono_Regular_8_glyph_79, + Font_PixelOperatorMono_Regular_8_glyph_80, + Font_PixelOperatorMono_Regular_8_glyph_81, + Font_PixelOperatorMono_Regular_8_glyph_82, + Font_PixelOperatorMono_Regular_8_glyph_83, + Font_PixelOperatorMono_Regular_8_glyph_84, + Font_PixelOperatorMono_Regular_8_glyph_85, + Font_PixelOperatorMono_Regular_8_glyph_86, + Font_PixelOperatorMono_Regular_8_glyph_87, + Font_PixelOperatorMono_Regular_8_glyph_88, + Font_PixelOperatorMono_Regular_8_glyph_89, + Font_PixelOperatorMono_Regular_8_glyph_90, + Font_PixelOperatorMono_Regular_8_glyph_91, + Font_PixelOperatorMono_Regular_8_glyph_92, + Font_PixelOperatorMono_Regular_8_glyph_93, + Font_PixelOperatorMono_Regular_8_glyph_94, + Font_PixelOperatorMono_Regular_8_glyph_95, + Font_PixelOperatorMono_Regular_8_glyph_96, + Font_PixelOperatorMono_Regular_8_glyph_97, + Font_PixelOperatorMono_Regular_8_glyph_98, + Font_PixelOperatorMono_Regular_8_glyph_99, + Font_PixelOperatorMono_Regular_8_glyph_100, + Font_PixelOperatorMono_Regular_8_glyph_101, + Font_PixelOperatorMono_Regular_8_glyph_102, + Font_PixelOperatorMono_Regular_8_glyph_103, + Font_PixelOperatorMono_Regular_8_glyph_104, + Font_PixelOperatorMono_Regular_8_glyph_105, + Font_PixelOperatorMono_Regular_8_glyph_106, + Font_PixelOperatorMono_Regular_8_glyph_107, + Font_PixelOperatorMono_Regular_8_glyph_108, + Font_PixelOperatorMono_Regular_8_glyph_109, + Font_PixelOperatorMono_Regular_8_glyph_110, + Font_PixelOperatorMono_Regular_8_glyph_111, + Font_PixelOperatorMono_Regular_8_glyph_112, + Font_PixelOperatorMono_Regular_8_glyph_113, + Font_PixelOperatorMono_Regular_8_glyph_114, + Font_PixelOperatorMono_Regular_8_glyph_115, + Font_PixelOperatorMono_Regular_8_glyph_116, + Font_PixelOperatorMono_Regular_8_glyph_117, + Font_PixelOperatorMono_Regular_8_glyph_118, + Font_PixelOperatorMono_Regular_8_glyph_119, + Font_PixelOperatorMono_Regular_8_glyph_120, + Font_PixelOperatorMono_Regular_8_glyph_121, + Font_PixelOperatorMono_Regular_8_glyph_122, + Font_PixelOperatorMono_Regular_8_glyph_123, + Font_PixelOperatorMono_Regular_8_glyph_124, + Font_PixelOperatorMono_Regular_8_glyph_125, + Font_PixelOperatorMono_Regular_8_glyph_126, +}; diff --git a/core/embed/extmod/modtrezorui/font_pixeloperatormono_regular_8.h b/core/embed/extmod/modtrezorui/font_pixeloperatormono_regular_8.h new file mode 100644 index 000000000..e6a82988a --- /dev/null +++ b/core/embed/extmod/modtrezorui/font_pixeloperatormono_regular_8.h @@ -0,0 +1,7 @@ +#include + +#if TREZOR_FONT_BPP != 1 +#error Wrong TREZOR_FONT_BPP (expected 1) +#endif +extern const uint8_t* const Font_PixelOperatorMono_Regular_8[126 + 1 - 32]; +extern const uint8_t Font_PixelOperatorMono_Regular_8_glyph_nonprintable[]; diff --git a/core/embed/extmod/modtrezorui/font_roboto_bold_20.c b/core/embed/extmod/modtrezorui/font_roboto_bold_20.c index 04b4c4cb3..4b08ac8bd 100644 --- a/core/embed/extmod/modtrezorui/font_roboto_bold_20.c +++ b/core/embed/extmod/modtrezorui/font_roboto_bold_20.c @@ -1,4 +1,4 @@ -#include "font_roboto_bold_20.h" +#include // first two bytes are width and height of the glyph // third, fourth and fifth bytes are advance diff --git a/core/embed/extmod/modtrezorui/font_roboto_bold_20.h b/core/embed/extmod/modtrezorui/font_roboto_bold_20.h index 94a72d9c0..c04432fcd 100644 --- a/core/embed/extmod/modtrezorui/font_roboto_bold_20.h +++ b/core/embed/extmod/modtrezorui/font_roboto_bold_20.h @@ -1,4 +1,7 @@ #include +#if TREZOR_FONT_BPP != 4 +#error Wrong TREZOR_FONT_BPP (expected 4) +#endif extern const uint8_t* const Font_Roboto_Bold_20[126 + 1 - 32]; extern const uint8_t Font_Roboto_Bold_20_glyph_nonprintable[]; diff --git a/core/embed/extmod/modtrezorui/font_roboto_regular_20.c b/core/embed/extmod/modtrezorui/font_roboto_regular_20.c index c0749ee48..ea28fa5c8 100644 --- a/core/embed/extmod/modtrezorui/font_roboto_regular_20.c +++ b/core/embed/extmod/modtrezorui/font_roboto_regular_20.c @@ -1,4 +1,4 @@ -#include "font_roboto_regular_20.h" +#include // first two bytes are width and height of the glyph // third, fourth and fifth bytes are advance diff --git a/core/embed/extmod/modtrezorui/font_roboto_regular_20.h b/core/embed/extmod/modtrezorui/font_roboto_regular_20.h index c5bef3a3c..a651b9a6b 100644 --- a/core/embed/extmod/modtrezorui/font_roboto_regular_20.h +++ b/core/embed/extmod/modtrezorui/font_roboto_regular_20.h @@ -1,4 +1,7 @@ #include +#if TREZOR_FONT_BPP != 4 +#error Wrong TREZOR_FONT_BPP (expected 4) +#endif extern const uint8_t* const Font_Roboto_Regular_20[126 + 1 - 32]; extern const uint8_t Font_Roboto_Regular_20_glyph_nonprintable[]; diff --git a/core/embed/extmod/modtrezorui/font_robotomono_regular_20.c b/core/embed/extmod/modtrezorui/font_robotomono_regular_20.c index bf9e5d44d..15aa9f890 100644 --- a/core/embed/extmod/modtrezorui/font_robotomono_regular_20.c +++ b/core/embed/extmod/modtrezorui/font_robotomono_regular_20.c @@ -1,4 +1,4 @@ -#include "font_robotomono_regular_20.h" +#include // first two bytes are width and height of the glyph // third, fourth and fifth bytes are advance diff --git a/core/embed/extmod/modtrezorui/font_robotomono_regular_20.h b/core/embed/extmod/modtrezorui/font_robotomono_regular_20.h index bc4a1657a..d6af8eec0 100644 --- a/core/embed/extmod/modtrezorui/font_robotomono_regular_20.h +++ b/core/embed/extmod/modtrezorui/font_robotomono_regular_20.h @@ -1,4 +1,7 @@ #include +#if TREZOR_FONT_BPP != 4 +#error Wrong TREZOR_FONT_BPP (expected 4) +#endif extern const uint8_t* const Font_RobotoMono_Regular_20[126 + 1 - 32]; extern const uint8_t Font_RobotoMono_Regular_20_glyph_nonprintable[]; diff --git a/core/tools/codegen/fonts/PixelOperator-Bold.ttf b/core/tools/codegen/fonts/PixelOperator-Bold.ttf new file mode 100644 index 000000000..10225eb8e Binary files /dev/null and b/core/tools/codegen/fonts/PixelOperator-Bold.ttf differ diff --git a/core/tools/codegen/fonts/PixelOperator-LICENSE.txt b/core/tools/codegen/fonts/PixelOperator-LICENSE.txt new file mode 100644 index 000000000..354f1e04f --- /dev/null +++ b/core/tools/codegen/fonts/PixelOperator-LICENSE.txt @@ -0,0 +1,121 @@ +Creative Commons Legal Code + +CC0 1.0 Universal + + CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE + LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN + ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS + INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES + REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS + PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM + THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED + HEREUNDER. + +Statement of Purpose + +The laws of most jurisdictions throughout the world automatically confer +exclusive Copyright and Related Rights (defined below) upon the creator +and subsequent owner(s) (each and all, an "owner") of an original work of +authorship and/or a database (each, a "Work"). + +Certain owners wish to permanently relinquish those rights to a Work for +the purpose of contributing to a commons of creative, cultural and +scientific works ("Commons") that the public can reliably and without fear +of later claims of infringement build upon, modify, incorporate in other +works, reuse and redistribute as freely as possible in any form whatsoever +and for any purposes, including without limitation commercial purposes. +These owners may contribute to the Commons to promote the ideal of a free +culture and the further production of creative, cultural and scientific +works, or to gain reputation or greater distribution for their Work in +part through the use and efforts of others. + +For these and/or other purposes and motivations, and without any +expectation of additional consideration or compensation, the person +associating CC0 with a Work (the "Affirmer"), to the extent that he or she +is an owner of Copyright and Related Rights in the Work, voluntarily +elects to apply CC0 to the Work and publicly distribute the Work under its +terms, with knowledge of his or her Copyright and Related Rights in the +Work and the meaning and intended legal effect of CC0 on those rights. + +1. Copyright and Related Rights. A Work made available under CC0 may be +protected by copyright and related or neighboring rights ("Copyright and +Related Rights"). Copyright and Related Rights include, but are not +limited to, the following: + + i. the right to reproduce, adapt, distribute, perform, display, + communicate, and translate a Work; + ii. moral rights retained by the original author(s) and/or performer(s); +iii. publicity and privacy rights pertaining to a person's image or + likeness depicted in a Work; + iv. rights protecting against unfair competition in regards to a Work, + subject to the limitations in paragraph 4(a), below; + v. rights protecting the extraction, dissemination, use and reuse of data + in a Work; + vi. database rights (such as those arising under Directive 96/9/EC of the + European Parliament and of the Council of 11 March 1996 on the legal + protection of databases, and under any national implementation + thereof, including any amended or successor version of such + directive); and +vii. other similar, equivalent or corresponding rights throughout the + world based on applicable law or treaty, and any national + implementations thereof. + +2. Waiver. To the greatest extent permitted by, but not in contravention +of, applicable law, Affirmer hereby overtly, fully, permanently, +irrevocably and unconditionally waives, abandons, and surrenders all of +Affirmer's Copyright and Related Rights and associated claims and causes +of action, whether now known or unknown (including existing as well as +future claims and causes of action), in the Work (i) in all territories +worldwide, (ii) for the maximum duration provided by applicable law or +treaty (including future time extensions), (iii) in any current or future +medium and for any number of copies, and (iv) for any purpose whatsoever, +including without limitation commercial, advertising or promotional +purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each +member of the public at large and to the detriment of Affirmer's heirs and +successors, fully intending that such Waiver shall not be subject to +revocation, rescission, cancellation, termination, or any other legal or +equitable action to disrupt the quiet enjoyment of the Work by the public +as contemplated by Affirmer's express Statement of Purpose. + +3. Public License Fallback. Should any part of the Waiver for any reason +be judged legally invalid or ineffective under applicable law, then the +Waiver shall be preserved to the maximum extent permitted taking into +account Affirmer's express Statement of Purpose. In addition, to the +extent the Waiver is so judged Affirmer hereby grants to each affected +person a royalty-free, non transferable, non sublicensable, non exclusive, +irrevocable and unconditional license to exercise Affirmer's Copyright and +Related Rights in the Work (i) in all territories worldwide, (ii) for the +maximum duration provided by applicable law or treaty (including future +time extensions), (iii) in any current or future medium and for any number +of copies, and (iv) for any purpose whatsoever, including without +limitation commercial, advertising or promotional purposes (the +"License"). The License shall be deemed effective as of the date CC0 was +applied by Affirmer to the Work. Should any part of the License for any +reason be judged legally invalid or ineffective under applicable law, such +partial invalidity or ineffectiveness shall not invalidate the remainder +of the License, and in such case Affirmer hereby affirms that he or she +will not (i) exercise any of his or her remaining Copyright and Related +Rights in the Work or (ii) assert any associated claims and causes of +action with respect to the Work, in either case contrary to Affirmer's +express Statement of Purpose. + +4. Limitations and Disclaimers. + + a. No trademark or patent rights held by Affirmer are waived, abandoned, + surrendered, licensed or otherwise affected by this document. + b. Affirmer offers the Work as-is and makes no representations or + warranties of any kind concerning the Work, express, implied, + statutory or otherwise, including without limitation warranties of + title, merchantability, fitness for a particular purpose, non + infringement, or the absence of latent or other defects, accuracy, or + the present or absence of errors, whether or not discoverable, all to + the greatest extent permissible under applicable law. + c. Affirmer disclaims responsibility for clearing rights of other persons + that may apply to the Work or any use thereof, including without + limitation any person's Copyright and Related Rights in the Work. + Further, Affirmer disclaims responsibility for obtaining any necessary + consents, permissions or other rights required for any use of the + Work. + d. Affirmer understands and acknowledges that Creative Commons is not a + party to this document and has no duty or obligation with respect to + this CC0 or use of the Work. diff --git a/core/tools/codegen/fonts/PixelOperator-Regular.ttf b/core/tools/codegen/fonts/PixelOperator-Regular.ttf new file mode 100644 index 000000000..f9146acf8 Binary files /dev/null and b/core/tools/codegen/fonts/PixelOperator-Regular.ttf differ diff --git a/core/tools/codegen/fonts/PixelOperatorMono-LICENSE.txt b/core/tools/codegen/fonts/PixelOperatorMono-LICENSE.txt new file mode 100644 index 000000000..354f1e04f --- /dev/null +++ b/core/tools/codegen/fonts/PixelOperatorMono-LICENSE.txt @@ -0,0 +1,121 @@ +Creative Commons Legal Code + +CC0 1.0 Universal + + CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE + LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN + ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS + INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES + REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS + PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM + THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED + HEREUNDER. + +Statement of Purpose + +The laws of most jurisdictions throughout the world automatically confer +exclusive Copyright and Related Rights (defined below) upon the creator +and subsequent owner(s) (each and all, an "owner") of an original work of +authorship and/or a database (each, a "Work"). + +Certain owners wish to permanently relinquish those rights to a Work for +the purpose of contributing to a commons of creative, cultural and +scientific works ("Commons") that the public can reliably and without fear +of later claims of infringement build upon, modify, incorporate in other +works, reuse and redistribute as freely as possible in any form whatsoever +and for any purposes, including without limitation commercial purposes. +These owners may contribute to the Commons to promote the ideal of a free +culture and the further production of creative, cultural and scientific +works, or to gain reputation or greater distribution for their Work in +part through the use and efforts of others. + +For these and/or other purposes and motivations, and without any +expectation of additional consideration or compensation, the person +associating CC0 with a Work (the "Affirmer"), to the extent that he or she +is an owner of Copyright and Related Rights in the Work, voluntarily +elects to apply CC0 to the Work and publicly distribute the Work under its +terms, with knowledge of his or her Copyright and Related Rights in the +Work and the meaning and intended legal effect of CC0 on those rights. + +1. Copyright and Related Rights. A Work made available under CC0 may be +protected by copyright and related or neighboring rights ("Copyright and +Related Rights"). Copyright and Related Rights include, but are not +limited to, the following: + + i. the right to reproduce, adapt, distribute, perform, display, + communicate, and translate a Work; + ii. moral rights retained by the original author(s) and/or performer(s); +iii. publicity and privacy rights pertaining to a person's image or + likeness depicted in a Work; + iv. rights protecting against unfair competition in regards to a Work, + subject to the limitations in paragraph 4(a), below; + v. rights protecting the extraction, dissemination, use and reuse of data + in a Work; + vi. database rights (such as those arising under Directive 96/9/EC of the + European Parliament and of the Council of 11 March 1996 on the legal + protection of databases, and under any national implementation + thereof, including any amended or successor version of such + directive); and +vii. other similar, equivalent or corresponding rights throughout the + world based on applicable law or treaty, and any national + implementations thereof. + +2. Waiver. To the greatest extent permitted by, but not in contravention +of, applicable law, Affirmer hereby overtly, fully, permanently, +irrevocably and unconditionally waives, abandons, and surrenders all of +Affirmer's Copyright and Related Rights and associated claims and causes +of action, whether now known or unknown (including existing as well as +future claims and causes of action), in the Work (i) in all territories +worldwide, (ii) for the maximum duration provided by applicable law or +treaty (including future time extensions), (iii) in any current or future +medium and for any number of copies, and (iv) for any purpose whatsoever, +including without limitation commercial, advertising or promotional +purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each +member of the public at large and to the detriment of Affirmer's heirs and +successors, fully intending that such Waiver shall not be subject to +revocation, rescission, cancellation, termination, or any other legal or +equitable action to disrupt the quiet enjoyment of the Work by the public +as contemplated by Affirmer's express Statement of Purpose. + +3. Public License Fallback. Should any part of the Waiver for any reason +be judged legally invalid or ineffective under applicable law, then the +Waiver shall be preserved to the maximum extent permitted taking into +account Affirmer's express Statement of Purpose. In addition, to the +extent the Waiver is so judged Affirmer hereby grants to each affected +person a royalty-free, non transferable, non sublicensable, non exclusive, +irrevocable and unconditional license to exercise Affirmer's Copyright and +Related Rights in the Work (i) in all territories worldwide, (ii) for the +maximum duration provided by applicable law or treaty (including future +time extensions), (iii) in any current or future medium and for any number +of copies, and (iv) for any purpose whatsoever, including without +limitation commercial, advertising or promotional purposes (the +"License"). The License shall be deemed effective as of the date CC0 was +applied by Affirmer to the Work. Should any part of the License for any +reason be judged legally invalid or ineffective under applicable law, such +partial invalidity or ineffectiveness shall not invalidate the remainder +of the License, and in such case Affirmer hereby affirms that he or she +will not (i) exercise any of his or her remaining Copyright and Related +Rights in the Work or (ii) assert any associated claims and causes of +action with respect to the Work, in either case contrary to Affirmer's +express Statement of Purpose. + +4. Limitations and Disclaimers. + + a. No trademark or patent rights held by Affirmer are waived, abandoned, + surrendered, licensed or otherwise affected by this document. + b. Affirmer offers the Work as-is and makes no representations or + warranties of any kind concerning the Work, express, implied, + statutory or otherwise, including without limitation warranties of + title, merchantability, fitness for a particular purpose, non + infringement, or the absence of latent or other defects, accuracy, or + the present or absence of errors, whether or not discoverable, all to + the greatest extent permissible under applicable law. + c. Affirmer disclaims responsibility for clearing rights of other persons + that may apply to the Work or any use thereof, including without + limitation any person's Copyright and Related Rights in the Work. + Further, Affirmer disclaims responsibility for obtaining any necessary + consents, permissions or other rights required for any use of the + Work. + d. Affirmer understands and acknowledges that Creative Commons is not a + party to this document and has no duty or obligation with respect to + this CC0 or use of the Work. diff --git a/core/tools/codegen/fonts/PixelOperatorMono-Regular.ttf b/core/tools/codegen/fonts/PixelOperatorMono-Regular.ttf new file mode 100644 index 000000000..9e871eaf3 Binary files /dev/null and b/core/tools/codegen/fonts/PixelOperatorMono-Regular.ttf differ diff --git a/core/tools/codegen/fonts/Roboto-Bold.ttf b/core/tools/codegen/fonts/Roboto-Bold.ttf new file mode 100644 index 000000000..d998cf5b4 Binary files /dev/null and b/core/tools/codegen/fonts/Roboto-Bold.ttf differ diff --git a/core/tools/codegen/fonts/Roboto-LICENSE.txt b/core/tools/codegen/fonts/Roboto-LICENSE.txt new file mode 100644 index 000000000..75b52484e --- /dev/null +++ b/core/tools/codegen/fonts/Roboto-LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/core/tools/codegen/fonts/Roboto-Regular.ttf b/core/tools/codegen/fonts/Roboto-Regular.ttf new file mode 100644 index 000000000..2b6392ffe Binary files /dev/null and b/core/tools/codegen/fonts/Roboto-Regular.ttf differ diff --git a/core/tools/codegen/fonts/RobotoMono-LICENSE.txt b/core/tools/codegen/fonts/RobotoMono-LICENSE.txt new file mode 100644 index 000000000..75b52484e --- /dev/null +++ b/core/tools/codegen/fonts/RobotoMono-LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/core/tools/codegen/fonts/RobotoMono-Regular.ttf b/core/tools/codegen/fonts/RobotoMono-Regular.ttf new file mode 100644 index 000000000..7c4ce36a4 Binary files /dev/null and b/core/tools/codegen/fonts/RobotoMono-Regular.ttf differ diff --git a/core/tools/codegen/gen_font.py b/core/tools/codegen/gen_font.py index 9d9c6844b..2a57176eb 100755 --- a/core/tools/codegen/gen_font.py +++ b/core/tools/codegen/gen_font.py @@ -8,44 +8,70 @@ import freetype MIN_GLYPH = ord(" ") MAX_GLYPH = ord("~") -FONT_BPP = 4 - # metrics explanation: https://www.freetype.org/freetype2/docs/glyphs/metrics.png -def process_bitmap_buffer(buf): +def process_bitmap_buffer(buf, bpp): res = buf[:] - if FONT_BPP == 2: + if bpp == 1: + for _ in range(8 - len(res) % 8): + res.append(0) + res = [ + ( + (a & 0x80) + | ((b & 0x80) >> 1) + | ((c & 0x80) >> 2) + | ((d & 0x80) >> 3) + | ((e & 0x80) >> 4) + | ((f & 0x80) >> 5) + | ((g & 0x80) >> 6) + | ((h & 0x80) >> 7) + ) + for a, b, c, d, e, f, g, h in [ + res[i : i + 8] for i in range(0, len(res), 8) + ] + ] + elif bpp == 2: for _ in range(4 - len(res) % 4): res.append(0) res = [ ((a & 0xC0) | ((b & 0xC0) >> 2) | ((c & 0xC0) >> 4) | ((d & 0xC0) >> 6)) for a, b, c, d in [res[i : i + 4] for i in range(0, len(res), 4)] ] - elif FONT_BPP == 4: + elif bpp == 4: if len(res) % 2 > 0: res.append(0) res = [ ((a & 0xF0) | (b >> 4)) for a, b in [res[i : i + 2] for i in range(0, len(res), 2)] ] + elif bpp == 8: + pass + else: + raise ValueError return res -def process_face(dirprefix, name, style, size): +def process_face(name, style, size, bpp=4): print("Processing ... %s %s %s" % (name, style, size)) - face = freetype.Face("%s/share/fonts/truetype/%s-%s.ttf" % (dirprefix, name, style)) + face = freetype.Face("fonts/%s-%s.ttf" % (name, style)) face.set_pixel_sizes(0, size) fontname = "%s_%s_%d" % (name.lower(), style.lower(), size) with open("font_%s.h" % fontname, "wt") as f: f.write("#include \n\n") + f.write("#if TREZOR_FONT_BPP != %d\n" % bpp) + f.write("#error Wrong TREZOR_FONT_BPP (expected %d)\n" % bpp) + f.write("#endif\n") f.write( "extern const uint8_t* const Font_%s_%s_%d[%d + 1 - %d];\n" + % (name, style, size, MAX_GLYPH, MIN_GLYPH) + ) + f.write( "extern const uint8_t Font_%s_%s_%d_glyph_nonprintable[];\n" - % (name, style, size, MAX_GLYPH, MIN_GLYPH, name, style, size) + % (name, style, size) ) with open("font_%s.c" % fontname, "wt") as f: - f.write('#include "font_%s.h"\n\n' % fontname) + f.write("#include \n\n") f.write("// first two bytes are width and height of the glyph\n") f.write("// third, fourth and fifth bytes are advance\n") f.write("// bearingX and bearingY of the horizontal metrics of the glyph\n") @@ -98,7 +124,8 @@ def process_face(dirprefix, name, style, size): buf = list(bitmap.buffer) if len(buf) > 0: f.write( - ", " + ", ".join(["%d" % x for x in process_bitmap_buffer(buf)]) + ", " + + ", ".join(["%d" % x for x in process_bitmap_buffer(buf, bpp)]) ) f.write(" };\n") @@ -108,7 +135,7 @@ def process_face(dirprefix, name, style, size): % (name, style, size, width, rows, advance, bearingX, bearingY) ) nonprintable += ", " + ", ".join( - ["%d" % (x ^ 0xFF) for x in process_bitmap_buffer(buf)] + ["%d" % (x ^ 0xFF) for x in process_bitmap_buffer(buf, bpp)] ) nonprintable += " };\n" @@ -123,6 +150,10 @@ def process_face(dirprefix, name, style, size): f.write("};\n") -process_face("/usr", "Roboto", "Regular", 20) -process_face("/usr", "Roboto", "Bold", 20) -process_face("/usr", "RobotoMono", "Regular", 20) +process_face("Roboto", "Regular", 20) +process_face("Roboto", "Bold", 20) +process_face("RobotoMono", "Regular", 20) + +process_face("PixelOperator", "Regular", 8, 1) +process_face("PixelOperator", "Bold", 8, 1) +process_face("PixelOperatorMono", "Regular", 8, 1)