From e43624f2d6f9f80ed624123d9c30d9ea325b239a Mon Sep 17 00:00:00 2001 From: obrusvit Date: Mon, 29 Apr 2024 21:30:23 +0200 Subject: [PATCH] fixup! refactor(tools): add only_upper option to gen_font --- .../lib/fonts/font_pixeloperator_bold_8.c | 4 +- .../fonts/font_pixeloperator_bold_upper_8.c | 82 +++++++------------ .../lib/fonts/font_pixeloperator_regular_8.c | 4 +- .../font_pixeloperator_regular_upper_8.c | 82 +++++++------------ .../lib/fonts/font_tthoves_bold_upper_17.c | 78 ++++++------------ core/tools/codegen/gen_font.py | 40 +++++---- 6 files changed, 112 insertions(+), 178 deletions(-) diff --git a/core/embed/lib/fonts/font_pixeloperator_bold_8.c b/core/embed/lib/fonts/font_pixeloperator_bold_8.c index 555db8077..d8f7b7d33 100644 --- a/core/embed/lib/fonts/font_pixeloperator_bold_8.c +++ b/core/embed/lib/fonts/font_pixeloperator_bold_8.c @@ -8,6 +8,8 @@ // - the third, fourth and fifth bytes are advance, bearingX and bearingY of the horizontal metrics of the glyph // - the rest is packed 1-bit glyph data +// NOTE: hand-changed the width and advance of '_' to 5 + /* */ 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, 5, 1, 7, 255, 204 }; /* " */ static const uint8_t Font_PixelOperator_Bold_8_glyph_34[] = { 5, 3, 6, 0, 7, 222, 246 }; @@ -71,7 +73,7 @@ /* \ */ static const uint8_t Font_PixelOperator_Bold_8_glyph_92[] = { 4, 7, 5, 0, 7, 204, 102, 99, 48 }; /* ] */ static const uint8_t Font_PixelOperator_Bold_8_glyph_93[] = { 4, 7, 6, 0, 7, 243, 51, 51, 240 }; /* ^ */ static const uint8_t Font_PixelOperator_Bold_8_glyph_94[] = { 6, 4, 7, 0, 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_95[] = { 5, 1, 5, 0, 0, 248 }; // width (1st), advance (3rd) changed to 5, last byte to 248 /* ` */ static const uint8_t Font_PixelOperator_Bold_8_glyph_96[] = { 3, 2, 5, 0, 7, 204 }; /* a */ static const uint8_t Font_PixelOperator_Bold_8_glyph_97[] = { 6, 5, 7, 0, 5, 120, 55, 243, 124 }; /* b */ static const uint8_t Font_PixelOperator_Bold_8_glyph_98[] = { 6, 7, 7, 0, 7, 195, 15, 179, 207, 63, 128 }; diff --git a/core/embed/lib/fonts/font_pixeloperator_bold_upper_8.c b/core/embed/lib/fonts/font_pixeloperator_bold_upper_8.c index 506d11efe..333289b62 100644 --- a/core/embed/lib/fonts/font_pixeloperator_bold_upper_8.c +++ b/core/embed/lib/fonts/font_pixeloperator_bold_upper_8.c @@ -8,6 +8,8 @@ // - the third, fourth and fifth bytes are advance, bearingX and bearingY of the horizontal metrics of the glyph // - the rest is packed 1-bit glyph data +// NOTE: hand-changed the width and advance of '_' to 5 + /* */ static const uint8_t Font_PixelOperator_Bold_upper_8_glyph_32[] = { 0, 0, 4, 0, 0 }; /* ! */ static const uint8_t Font_PixelOperator_Bold_upper_8_glyph_33[] = { 2, 7, 5, 1, 7, 255, 204 }; /* " */ static const uint8_t Font_PixelOperator_Bold_upper_8_glyph_34[] = { 5, 3, 6, 0, 7, 222, 246 }; @@ -71,34 +73,8 @@ /* \ */ static const uint8_t Font_PixelOperator_Bold_upper_8_glyph_92[] = { 4, 7, 5, 0, 7, 204, 102, 99, 48 }; /* ] */ static const uint8_t Font_PixelOperator_Bold_upper_8_glyph_93[] = { 4, 7, 6, 0, 7, 243, 51, 51, 240 }; /* ^ */ static const uint8_t Font_PixelOperator_Bold_upper_8_glyph_94[] = { 6, 4, 7, 0, 7, 49, 236, 225, 0 }; -/* _ */ static const uint8_t Font_PixelOperator_Bold_upper_8_glyph_95[] = { 5, 1, 5, 0, 0, 248 }; +/* _ */ static const uint8_t Font_PixelOperator_Bold_upper_8_glyph_95[] = { 5, 1, 5, 0, 0, 248 }; // width (1st), advance (3rd) changed to 5, last byte to 248 /* ` */ static const uint8_t Font_PixelOperator_Bold_upper_8_glyph_96[] = { 3, 2, 5, 0, 7, 204 }; -/* a -> A */ static const uint8_t Font_PixelOperator_Bold_upper_8_glyph_97[] = { 6, 7, 7, 0, 7, 123, 60, 243, 255, 60, 192 }; -/* b -> B */ static const uint8_t Font_PixelOperator_Bold_upper_8_glyph_98[] = { 6, 7, 7, 0, 7, 251, 60, 254, 207, 63, 128 }; -/* c -> C */ static const uint8_t Font_PixelOperator_Bold_upper_8_glyph_99[] = { 6, 7, 7, 0, 7, 123, 60, 48, 195, 55, 128 }; -/* d -> D */ static const uint8_t Font_PixelOperator_Bold_upper_8_glyph_100[] = { 6, 7, 7, 0, 7, 251, 60, 243, 207, 63, 128 }; -/* e -> E */ static const uint8_t Font_PixelOperator_Bold_upper_8_glyph_101[] = { 6, 7, 7, 0, 7, 255, 12, 60, 195, 15, 192 }; -/* f -> F */ static const uint8_t Font_PixelOperator_Bold_upper_8_glyph_102[] = { 6, 7, 7, 0, 7, 255, 12, 60, 195, 12, 0 }; -/* g -> G */ static const uint8_t Font_PixelOperator_Bold_upper_8_glyph_103[] = { 6, 7, 7, 0, 7, 123, 60, 55, 207, 55, 192 }; -/* h -> H */ static const uint8_t Font_PixelOperator_Bold_upper_8_glyph_104[] = { 6, 7, 7, 0, 7, 207, 60, 255, 207, 60, 192 }; -/* i -> I */ static const uint8_t Font_PixelOperator_Bold_upper_8_glyph_105[] = { 2, 7, 5, 1, 7, 255, 252 }; -/* j -> J */ static const uint8_t Font_PixelOperator_Bold_upper_8_glyph_106[] = { 6, 7, 7, 0, 7, 12, 48, 195, 15, 55, 128 }; -/* k -> K */ static const uint8_t Font_PixelOperator_Bold_upper_8_glyph_107[] = { 6, 7, 7, 0, 7, 207, 111, 56, 243, 108, 192 }; -/* l -> L */ static const uint8_t Font_PixelOperator_Bold_upper_8_glyph_108[] = { 6, 7, 7, 0, 7, 195, 12, 48, 195, 15, 192 }; -/* m -> M */ static const uint8_t Font_PixelOperator_Bold_upper_8_glyph_109[] = { 7, 7, 8, 0, 7, 199, 143, 191, 253, 120, 241, 128 }; -/* n -> N */ static const uint8_t Font_PixelOperator_Bold_upper_8_glyph_110[] = { 6, 7, 7, 0, 7, 207, 62, 255, 223, 60, 192 }; -/* o -> O */ static const uint8_t Font_PixelOperator_Bold_upper_8_glyph_111[] = { 6, 7, 7, 0, 7, 123, 60, 243, 207, 55, 128 }; -/* p -> P */ static const uint8_t Font_PixelOperator_Bold_upper_8_glyph_112[] = { 6, 7, 7, 0, 7, 251, 60, 243, 251, 12, 0 }; -/* q -> Q */ static const uint8_t Font_PixelOperator_Bold_upper_8_glyph_113[] = { 6, 7, 7, 0, 7, 123, 60, 251, 255, 102, 192 }; -/* r -> R */ static const uint8_t Font_PixelOperator_Bold_upper_8_glyph_114[] = { 6, 7, 7, 0, 7, 251, 60, 243, 251, 108, 192 }; -/* s -> S */ static const uint8_t Font_PixelOperator_Bold_upper_8_glyph_115[] = { 6, 7, 7, 0, 7, 123, 60, 30, 15, 55, 128 }; -/* t -> T */ static const uint8_t Font_PixelOperator_Bold_upper_8_glyph_116[] = { 6, 7, 7, 0, 7, 252, 195, 12, 48, 195, 0 }; -/* u -> U */ static const uint8_t Font_PixelOperator_Bold_upper_8_glyph_117[] = { 6, 7, 7, 0, 7, 207, 60, 243, 207, 55, 128 }; -/* v -> V */ static const uint8_t Font_PixelOperator_Bold_upper_8_glyph_118[] = { 6, 7, 7, 0, 7, 207, 60, 243, 205, 227, 0 }; -/* w -> W */ static const uint8_t Font_PixelOperator_Bold_upper_8_glyph_119[] = { 7, 7, 8, 0, 7, 199, 143, 94, 189, 122, 219, 0 }; -/* x -> X */ static const uint8_t Font_PixelOperator_Bold_upper_8_glyph_120[] = { 6, 7, 7, 0, 7, 207, 55, 140, 123, 60, 192 }; -/* y -> Y */ static const uint8_t Font_PixelOperator_Bold_upper_8_glyph_121[] = { 6, 7, 7, 0, 7, 207, 55, 140, 48, 195, 0 }; -/* z -> Z */ static const uint8_t Font_PixelOperator_Bold_upper_8_glyph_122[] = { 6, 7, 7, 0, 7, 252, 49, 140, 99, 15, 192 }; /* { */ static const uint8_t Font_PixelOperator_Bold_upper_8_glyph_123[] = { 5, 7, 6, 0, 7, 59, 25, 134, 48, 224 }; /* | */ static const uint8_t Font_PixelOperator_Bold_upper_8_glyph_124[] = { 2, 7, 5, 1, 7, 255, 252 }; /* } */ static const uint8_t Font_PixelOperator_Bold_upper_8_glyph_125[] = { 5, 7, 6, 0, 7, 225, 140, 51, 27, 128 }; @@ -172,32 +148,32 @@ const uint8_t * const Font_PixelOperator_Bold_upper_8[126 + 1 - 32] = { Font_PixelOperator_Bold_upper_8_glyph_94, Font_PixelOperator_Bold_upper_8_glyph_95, Font_PixelOperator_Bold_upper_8_glyph_96, - Font_PixelOperator_Bold_upper_8_glyph_97, - Font_PixelOperator_Bold_upper_8_glyph_98, - Font_PixelOperator_Bold_upper_8_glyph_99, - Font_PixelOperator_Bold_upper_8_glyph_100, - Font_PixelOperator_Bold_upper_8_glyph_101, - Font_PixelOperator_Bold_upper_8_glyph_102, - Font_PixelOperator_Bold_upper_8_glyph_103, - Font_PixelOperator_Bold_upper_8_glyph_104, - Font_PixelOperator_Bold_upper_8_glyph_105, - Font_PixelOperator_Bold_upper_8_glyph_106, - Font_PixelOperator_Bold_upper_8_glyph_107, - Font_PixelOperator_Bold_upper_8_glyph_108, - Font_PixelOperator_Bold_upper_8_glyph_109, - Font_PixelOperator_Bold_upper_8_glyph_110, - Font_PixelOperator_Bold_upper_8_glyph_111, - Font_PixelOperator_Bold_upper_8_glyph_112, - Font_PixelOperator_Bold_upper_8_glyph_113, - Font_PixelOperator_Bold_upper_8_glyph_114, - Font_PixelOperator_Bold_upper_8_glyph_115, - Font_PixelOperator_Bold_upper_8_glyph_116, - Font_PixelOperator_Bold_upper_8_glyph_117, - Font_PixelOperator_Bold_upper_8_glyph_118, - Font_PixelOperator_Bold_upper_8_glyph_119, - Font_PixelOperator_Bold_upper_8_glyph_120, - Font_PixelOperator_Bold_upper_8_glyph_121, - Font_PixelOperator_Bold_upper_8_glyph_122, + Font_PixelOperator_Bold_upper_8_glyph_65, // a -> A + Font_PixelOperator_Bold_upper_8_glyph_66, // b -> B + Font_PixelOperator_Bold_upper_8_glyph_67, // c -> C + Font_PixelOperator_Bold_upper_8_glyph_68, // d -> D + Font_PixelOperator_Bold_upper_8_glyph_69, // e -> E + Font_PixelOperator_Bold_upper_8_glyph_70, // f -> F + Font_PixelOperator_Bold_upper_8_glyph_71, // g -> G + Font_PixelOperator_Bold_upper_8_glyph_72, // h -> H + Font_PixelOperator_Bold_upper_8_glyph_73, // i -> I + Font_PixelOperator_Bold_upper_8_glyph_74, // j -> J + Font_PixelOperator_Bold_upper_8_glyph_75, // k -> K + Font_PixelOperator_Bold_upper_8_glyph_76, // l -> L + Font_PixelOperator_Bold_upper_8_glyph_77, // m -> M + Font_PixelOperator_Bold_upper_8_glyph_78, // n -> N + Font_PixelOperator_Bold_upper_8_glyph_79, // o -> O + Font_PixelOperator_Bold_upper_8_glyph_80, // p -> P + Font_PixelOperator_Bold_upper_8_glyph_81, // q -> Q + Font_PixelOperator_Bold_upper_8_glyph_82, // r -> R + Font_PixelOperator_Bold_upper_8_glyph_83, // s -> S + Font_PixelOperator_Bold_upper_8_glyph_84, // t -> T + Font_PixelOperator_Bold_upper_8_glyph_85, // u -> U + Font_PixelOperator_Bold_upper_8_glyph_86, // v -> V + Font_PixelOperator_Bold_upper_8_glyph_87, // w -> W + Font_PixelOperator_Bold_upper_8_glyph_88, // x -> X + Font_PixelOperator_Bold_upper_8_glyph_89, // y -> Y + Font_PixelOperator_Bold_upper_8_glyph_90, // z -> Z Font_PixelOperator_Bold_upper_8_glyph_123, Font_PixelOperator_Bold_upper_8_glyph_124, Font_PixelOperator_Bold_upper_8_glyph_125, diff --git a/core/embed/lib/fonts/font_pixeloperator_regular_8.c b/core/embed/lib/fonts/font_pixeloperator_regular_8.c index b60fecfcf..e01962c98 100644 --- a/core/embed/lib/fonts/font_pixeloperator_regular_8.c +++ b/core/embed/lib/fonts/font_pixeloperator_regular_8.c @@ -8,6 +8,8 @@ // - the third, fourth and fifth bytes are advance, bearingX and bearingY of the horizontal metrics of the glyph // - the rest is packed 1-bit glyph data +// NOTE: hand-changed the width and advance of '_' to 5 + /* */ 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, 4, 1, 7, 250 }; /* " */ static const uint8_t Font_PixelOperator_Regular_8_glyph_34[] = { 3, 3, 6, 1, 7, 182, 128 }; @@ -71,7 +73,7 @@ /* \ */ static const uint8_t Font_PixelOperator_Regular_8_glyph_92[] = { 3, 7, 4, 0, 7, 145, 36, 72 }; /* ] */ static const uint8_t Font_PixelOperator_Regular_8_glyph_93[] = { 3, 7, 6, 0, 7, 228, 146, 120 }; /* ^ */ static const uint8_t Font_PixelOperator_Regular_8_glyph_94[] = { 5, 3, 6, 0, 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_95[] = { 5, 1, 5, 0, 0, 248 }; // width (1st), advance (3rd) changed to 5, last byte to 248 /* ` */ static const uint8_t Font_PixelOperator_Regular_8_glyph_96[] = { 2, 2, 4, 0, 7, 144 }; /* a */ static const uint8_t Font_PixelOperator_Regular_8_glyph_97[] = { 5, 5, 6, 0, 5, 112, 95, 23, 128 }; /* b */ static const uint8_t Font_PixelOperator_Regular_8_glyph_98[] = { 5, 7, 6, 0, 7, 132, 61, 24, 199, 192 }; diff --git a/core/embed/lib/fonts/font_pixeloperator_regular_upper_8.c b/core/embed/lib/fonts/font_pixeloperator_regular_upper_8.c index e9a9c8ae5..9dc0bd1a8 100644 --- a/core/embed/lib/fonts/font_pixeloperator_regular_upper_8.c +++ b/core/embed/lib/fonts/font_pixeloperator_regular_upper_8.c @@ -8,6 +8,8 @@ // - the third, fourth and fifth bytes are advance, bearingX and bearingY of the horizontal metrics of the glyph // - the rest is packed 1-bit glyph data +// NOTE: hand-changed the width and advance of '_' to 5 + /* */ static const uint8_t Font_PixelOperator_Regular_upper_8_glyph_32[] = { 0, 0, 4, 0, 0 }; /* ! */ static const uint8_t Font_PixelOperator_Regular_upper_8_glyph_33[] = { 1, 7, 4, 1, 7, 250 }; /* " */ static const uint8_t Font_PixelOperator_Regular_upper_8_glyph_34[] = { 3, 3, 6, 1, 7, 182, 128 }; @@ -71,34 +73,8 @@ /* \ */ static const uint8_t Font_PixelOperator_Regular_upper_8_glyph_92[] = { 3, 7, 4, 0, 7, 145, 36, 72 }; /* ] */ static const uint8_t Font_PixelOperator_Regular_upper_8_glyph_93[] = { 3, 7, 6, 0, 7, 228, 146, 120 }; /* ^ */ static const uint8_t Font_PixelOperator_Regular_upper_8_glyph_94[] = { 5, 3, 6, 0, 7, 34, 162 }; -/* _ */ static const uint8_t Font_PixelOperator_Regular_upper_8_glyph_95[] = { 4, 1, 4, 0, 0, 240 }; +/* _ */ static const uint8_t Font_PixelOperator_Regular_upper_8_glyph_95[] = { 5, 1, 5, 0, 0, 248 }; // width (1st), advance (3rd) changed to 5, last byte to 248 /* ` */ static const uint8_t Font_PixelOperator_Regular_upper_8_glyph_96[] = { 2, 2, 4, 0, 7, 144 }; -/* a -> A */ static const uint8_t Font_PixelOperator_Regular_upper_8_glyph_97[] = { 5, 7, 6, 0, 7, 116, 99, 31, 198, 32 }; -/* b -> B */ static const uint8_t Font_PixelOperator_Regular_upper_8_glyph_98[] = { 5, 7, 6, 0, 7, 244, 99, 232, 199, 192 }; -/* c -> C */ static const uint8_t Font_PixelOperator_Regular_upper_8_glyph_99[] = { 5, 7, 6, 0, 7, 116, 97, 8, 69, 192 }; -/* d -> D */ static const uint8_t Font_PixelOperator_Regular_upper_8_glyph_100[] = { 5, 7, 6, 0, 7, 244, 99, 24, 199, 192 }; -/* e -> E */ static const uint8_t Font_PixelOperator_Regular_upper_8_glyph_101[] = { 5, 7, 6, 0, 7, 252, 33, 200, 67, 224 }; -/* f -> F */ static const uint8_t Font_PixelOperator_Regular_upper_8_glyph_102[] = { 5, 7, 6, 0, 7, 252, 33, 200, 66, 0 }; -/* g -> G */ static const uint8_t Font_PixelOperator_Regular_upper_8_glyph_103[] = { 5, 7, 6, 0, 7, 116, 97, 56, 197, 224 }; -/* h -> H */ static const uint8_t Font_PixelOperator_Regular_upper_8_glyph_104[] = { 5, 7, 6, 0, 7, 140, 99, 248, 198, 32 }; -/* i -> I */ static const uint8_t Font_PixelOperator_Regular_upper_8_glyph_105[] = { 1, 7, 4, 1, 7, 254 }; -/* j -> J */ static const uint8_t Font_PixelOperator_Regular_upper_8_glyph_106[] = { 5, 7, 6, 0, 7, 8, 66, 16, 197, 192 }; -/* k -> K */ static const uint8_t Font_PixelOperator_Regular_upper_8_glyph_107[] = { 5, 7, 6, 0, 7, 140, 169, 138, 74, 32 }; -/* l -> L */ static const uint8_t Font_PixelOperator_Regular_upper_8_glyph_108[] = { 5, 7, 6, 0, 7, 132, 33, 8, 67, 224 }; -/* m -> M */ static const uint8_t Font_PixelOperator_Regular_upper_8_glyph_109[] = { 7, 7, 8, 0, 7, 131, 7, 29, 89, 48, 96, 128 }; -/* n -> N */ static const uint8_t Font_PixelOperator_Regular_upper_8_glyph_110[] = { 5, 7, 6, 0, 7, 140, 115, 89, 198, 32 }; -/* o -> O */ static const uint8_t Font_PixelOperator_Regular_upper_8_glyph_111[] = { 5, 7, 6, 0, 7, 116, 99, 24, 197, 192 }; -/* p -> P */ static const uint8_t Font_PixelOperator_Regular_upper_8_glyph_112[] = { 5, 7, 6, 0, 7, 244, 99, 31, 66, 0 }; -/* q -> Q */ static const uint8_t Font_PixelOperator_Regular_upper_8_glyph_113[] = { 5, 7, 6, 0, 7, 116, 99, 26, 201, 160 }; -/* r -> R */ static const uint8_t Font_PixelOperator_Regular_upper_8_glyph_114[] = { 5, 7, 6, 0, 7, 244, 99, 31, 74, 32 }; -/* s -> S */ static const uint8_t Font_PixelOperator_Regular_upper_8_glyph_115[] = { 5, 7, 6, 0, 7, 116, 96, 224, 197, 192 }; -/* t -> T */ static const uint8_t Font_PixelOperator_Regular_upper_8_glyph_116[] = { 5, 7, 6, 0, 7, 249, 8, 66, 16, 128 }; -/* u -> U */ static const uint8_t Font_PixelOperator_Regular_upper_8_glyph_117[] = { 5, 7, 6, 0, 7, 140, 99, 24, 197, 192 }; -/* v -> V */ static const uint8_t Font_PixelOperator_Regular_upper_8_glyph_118[] = { 5, 7, 6, 0, 7, 140, 99, 24, 168, 128 }; -/* w -> W */ static const uint8_t Font_PixelOperator_Regular_upper_8_glyph_119[] = { 7, 7, 8, 0, 7, 131, 6, 76, 153, 50, 91, 0 }; -/* x -> X */ static const uint8_t Font_PixelOperator_Regular_upper_8_glyph_120[] = { 5, 7, 6, 0, 7, 140, 84, 69, 70, 32 }; -/* y -> Y */ static const uint8_t Font_PixelOperator_Regular_upper_8_glyph_121[] = { 5, 7, 6, 0, 7, 140, 84, 66, 16, 128 }; -/* z -> Z */ static const uint8_t Font_PixelOperator_Regular_upper_8_glyph_122[] = { 5, 7, 6, 0, 7, 248, 68, 68, 67, 224 }; /* { */ static const uint8_t Font_PixelOperator_Regular_upper_8_glyph_123[] = { 4, 7, 6, 1, 7, 52, 72, 68, 48 }; /* | */ static const uint8_t Font_PixelOperator_Regular_upper_8_glyph_124[] = { 1, 7, 4, 1, 7, 254 }; /* } */ static const uint8_t Font_PixelOperator_Regular_upper_8_glyph_125[] = { 4, 7, 6, 0, 7, 194, 33, 34, 192 }; @@ -172,32 +148,32 @@ const uint8_t * const Font_PixelOperator_Regular_upper_8[126 + 1 - 32] = { Font_PixelOperator_Regular_upper_8_glyph_94, Font_PixelOperator_Regular_upper_8_glyph_95, Font_PixelOperator_Regular_upper_8_glyph_96, - Font_PixelOperator_Regular_upper_8_glyph_97, - Font_PixelOperator_Regular_upper_8_glyph_98, - Font_PixelOperator_Regular_upper_8_glyph_99, - Font_PixelOperator_Regular_upper_8_glyph_100, - Font_PixelOperator_Regular_upper_8_glyph_101, - Font_PixelOperator_Regular_upper_8_glyph_102, - Font_PixelOperator_Regular_upper_8_glyph_103, - Font_PixelOperator_Regular_upper_8_glyph_104, - Font_PixelOperator_Regular_upper_8_glyph_105, - Font_PixelOperator_Regular_upper_8_glyph_106, - Font_PixelOperator_Regular_upper_8_glyph_107, - Font_PixelOperator_Regular_upper_8_glyph_108, - Font_PixelOperator_Regular_upper_8_glyph_109, - Font_PixelOperator_Regular_upper_8_glyph_110, - Font_PixelOperator_Regular_upper_8_glyph_111, - Font_PixelOperator_Regular_upper_8_glyph_112, - Font_PixelOperator_Regular_upper_8_glyph_113, - Font_PixelOperator_Regular_upper_8_glyph_114, - Font_PixelOperator_Regular_upper_8_glyph_115, - Font_PixelOperator_Regular_upper_8_glyph_116, - Font_PixelOperator_Regular_upper_8_glyph_117, - Font_PixelOperator_Regular_upper_8_glyph_118, - Font_PixelOperator_Regular_upper_8_glyph_119, - Font_PixelOperator_Regular_upper_8_glyph_120, - Font_PixelOperator_Regular_upper_8_glyph_121, - Font_PixelOperator_Regular_upper_8_glyph_122, + Font_PixelOperator_Regular_upper_8_glyph_65, // a -> A + Font_PixelOperator_Regular_upper_8_glyph_66, // b -> B + Font_PixelOperator_Regular_upper_8_glyph_67, // c -> C + Font_PixelOperator_Regular_upper_8_glyph_68, // d -> D + Font_PixelOperator_Regular_upper_8_glyph_69, // e -> E + Font_PixelOperator_Regular_upper_8_glyph_70, // f -> F + Font_PixelOperator_Regular_upper_8_glyph_71, // g -> G + Font_PixelOperator_Regular_upper_8_glyph_72, // h -> H + Font_PixelOperator_Regular_upper_8_glyph_73, // i -> I + Font_PixelOperator_Regular_upper_8_glyph_74, // j -> J + Font_PixelOperator_Regular_upper_8_glyph_75, // k -> K + Font_PixelOperator_Regular_upper_8_glyph_76, // l -> L + Font_PixelOperator_Regular_upper_8_glyph_77, // m -> M + Font_PixelOperator_Regular_upper_8_glyph_78, // n -> N + Font_PixelOperator_Regular_upper_8_glyph_79, // o -> O + Font_PixelOperator_Regular_upper_8_glyph_80, // p -> P + Font_PixelOperator_Regular_upper_8_glyph_81, // q -> Q + Font_PixelOperator_Regular_upper_8_glyph_82, // r -> R + Font_PixelOperator_Regular_upper_8_glyph_83, // s -> S + Font_PixelOperator_Regular_upper_8_glyph_84, // t -> T + Font_PixelOperator_Regular_upper_8_glyph_85, // u -> U + Font_PixelOperator_Regular_upper_8_glyph_86, // v -> V + Font_PixelOperator_Regular_upper_8_glyph_87, // w -> W + Font_PixelOperator_Regular_upper_8_glyph_88, // x -> X + Font_PixelOperator_Regular_upper_8_glyph_89, // y -> Y + Font_PixelOperator_Regular_upper_8_glyph_90, // z -> Z Font_PixelOperator_Regular_upper_8_glyph_123, Font_PixelOperator_Regular_upper_8_glyph_124, Font_PixelOperator_Regular_upper_8_glyph_125, diff --git a/core/embed/lib/fonts/font_tthoves_bold_upper_17.c b/core/embed/lib/fonts/font_tthoves_bold_upper_17.c index ef82a1ca8..3f645b2ea 100644 --- a/core/embed/lib/fonts/font_tthoves_bold_upper_17.c +++ b/core/embed/lib/fonts/font_tthoves_bold_upper_17.c @@ -73,32 +73,6 @@ /* ^ */ static const uint8_t Font_TTHoves_Bold_upper_17_glyph_94[] = { 8, 5, 8, 0, 12, 0, 251, 159, 0, 16, 255, 255, 0, 112, 207, 253, 5, 192, 111, 248, 10, 242, 31, 242, 31 }; /* _ */ static const uint8_t Font_TTHoves_Bold_upper_17_glyph_95[] = { 9, 3, 8, 0, 0, 82, 85, 85, 85, 0, 245, 255, 255, 255, 1, 245, 255, 255, 255, 1 }; /* ` */ static const uint8_t Font_TTHoves_Bold_upper_17_glyph_96[] = { 5, 3, 5, 0, 13, 114, 23, 0, 176, 175, 0, 0, 253, 5 }; -/* a -> A */ static const uint8_t Font_TTHoves_Bold_upper_17_glyph_97[] = { 13, 12, 13, 0, 12, 0, 0, 243, 255, 31, 0, 0, 0, 0, 248, 255, 111, 0, 0, 0, 0, 253, 255, 191, 0, 0, 0, 48, 255, 168, 255, 1, 0, 0, 128, 255, 83, 255, 6, 0, 0, 224, 239, 0, 255, 12, 0, 0, 243, 159, 0, 251, 31, 0, 0, 249, 255, 255, 255, 111, 0, 0, 254, 255, 255, 255, 207, 0, 48, 255, 107, 102, 198, 255, 1, 144, 255, 5, 0, 112, 255, 7, 224, 255, 0, 0, 32, 255, 12 }; -/* b -> B */ static const uint8_t Font_TTHoves_Bold_upper_17_glyph_98[] = { 10, 12, 11, 1, 12, 252, 255, 255, 174, 1, 252, 255, 255, 255, 13, 252, 111, 102, 253, 79, 252, 14, 0, 246, 111, 252, 95, 101, 253, 47, 252, 255, 255, 255, 7, 252, 255, 255, 255, 13, 252, 14, 0, 248, 111, 252, 14, 0, 243, 143, 252, 95, 101, 252, 127, 252, 255, 255, 255, 30, 252, 255, 255, 190, 2 }; -/* c -> C */ static const uint8_t Font_TTHoves_Bold_upper_17_glyph_99[] = { 12, 12, 12, 0, 12, 0, 32, 201, 223, 41, 0, 0, 245, 255, 255, 255, 4, 32, 255, 223, 235, 255, 30, 192, 255, 7, 0, 248, 143, 240, 191, 0, 0, 112, 104, 243, 127, 0, 0, 0, 0, 243, 127, 0, 0, 0, 0, 240, 191, 0, 0, 128, 121, 192, 255, 6, 0, 248, 143, 32, 255, 223, 218, 255, 30, 0, 245, 255, 255, 255, 4, 0, 32, 217, 223, 41, 0 }; -/* d -> D */ static const uint8_t Font_TTHoves_Bold_upper_17_glyph_100[] = { 11, 12, 12, 1, 12, 252, 255, 223, 41, 0, 0, 252, 255, 255, 255, 6, 0, 252, 175, 218, 255, 63, 0, 252, 14, 0, 246, 223, 0, 252, 14, 0, 176, 255, 1, 252, 14, 0, 96, 255, 4, 252, 14, 0, 96, 255, 4, 252, 14, 0, 176, 255, 1, 252, 14, 0, 246, 223, 0, 252, 159, 218, 255, 63, 0, 252, 255, 255, 255, 6, 0, 252, 255, 223, 41, 0, 0 }; -/* e -> E */ static const uint8_t Font_TTHoves_Bold_upper_17_glyph_101[] = { 9, 12, 10, 1, 12, 252, 255, 255, 255, 5, 252, 255, 255, 255, 5, 252, 127, 119, 119, 2, 252, 14, 0, 0, 0, 252, 14, 0, 0, 0, 252, 255, 255, 255, 0, 252, 255, 255, 255, 0, 252, 111, 102, 102, 0, 252, 14, 0, 0, 0, 252, 127, 119, 119, 2, 252, 255, 255, 255, 5, 252, 255, 255, 255, 5 }; -/* f -> F */ static const uint8_t Font_TTHoves_Bold_upper_17_glyph_102[] = { 9, 12, 10, 1, 12, 252, 255, 255, 255, 3, 252, 255, 255, 255, 3, 252, 127, 119, 119, 1, 252, 14, 0, 0, 0, 252, 14, 0, 0, 0, 252, 255, 255, 223, 0, 252, 255, 255, 223, 0, 252, 111, 102, 86, 0, 252, 14, 0, 0, 0, 252, 14, 0, 0, 0, 252, 14, 0, 0, 0, 252, 14, 0, 0, 0 }; -/* g -> G */ static const uint8_t Font_TTHoves_Bold_upper_17_glyph_103[] = { 12, 12, 13, 0, 12, 0, 16, 201, 223, 25, 0, 0, 245, 255, 255, 239, 2, 32, 255, 223, 235, 255, 30, 176, 255, 8, 0, 249, 143, 240, 207, 0, 0, 80, 69, 242, 143, 0, 0, 0, 0, 244, 127, 0, 245, 255, 255, 241, 175, 0, 213, 253, 255, 208, 255, 4, 0, 244, 255, 48, 255, 207, 202, 255, 255, 0, 246, 255, 255, 239, 255, 0, 32, 217, 223, 40, 255 }; -/* h -> H */ static const uint8_t Font_TTHoves_Bold_upper_17_glyph_104[] = { 11, 12, 12, 1, 12, 252, 14, 0, 128, 255, 3, 252, 14, 0, 128, 255, 3, 252, 14, 0, 128, 255, 3, 252, 14, 0, 128, 255, 3, 252, 207, 204, 236, 255, 3, 252, 255, 255, 255, 255, 3, 252, 255, 255, 255, 255, 3, 252, 14, 0, 128, 255, 3, 252, 14, 0, 128, 255, 3, 252, 14, 0, 128, 255, 3, 252, 14, 0, 128, 255, 3, 252, 14, 0, 128, 255, 3 }; -/* i -> I */ static const uint8_t Font_TTHoves_Bold_upper_17_glyph_105[] = { 3, 12, 5, 1, 12, 252, 14, 252, 14, 252, 14, 252, 14, 252, 14, 252, 14, 252, 14, 252, 14, 252, 14, 252, 14, 252, 14, 252, 14 }; -/* j -> J */ static const uint8_t Font_TTHoves_Bold_upper_17_glyph_106[] = { 7, 12, 7, 0, 12, 0, 128, 255, 3, 0, 128, 255, 3, 0, 128, 255, 3, 0, 128, 255, 3, 0, 128, 255, 3, 0, 128, 255, 3, 0, 128, 255, 3, 0, 128, 255, 3, 0, 128, 255, 3, 152, 234, 255, 2, 253, 255, 239, 0, 253, 255, 77, 0 }; -/* k -> K */ static const uint8_t Font_TTHoves_Bold_upper_17_glyph_107[] = { 11, 12, 11, 1, 12, 252, 14, 0, 254, 95, 0, 252, 14, 144, 255, 10, 0, 252, 14, 244, 239, 1, 0, 252, 30, 254, 79, 0, 0, 252, 174, 255, 9, 0, 0, 252, 255, 223, 0, 0, 0, 252, 255, 239, 1, 0, 0, 252, 126, 255, 12, 0, 0, 252, 14, 251, 127, 0, 0, 252, 14, 225, 255, 3, 0, 252, 14, 80, 255, 30, 0, 252, 14, 0, 250, 175, 0 }; -/* l -> L */ static const uint8_t Font_TTHoves_Bold_upper_17_glyph_108[] = { 9, 12, 10, 1, 12, 252, 14, 0, 0, 0, 252, 14, 0, 0, 0, 252, 14, 0, 0, 0, 252, 14, 0, 0, 0, 252, 14, 0, 0, 0, 252, 14, 0, 0, 0, 252, 14, 0, 0, 0, 252, 14, 0, 0, 0, 252, 14, 0, 0, 0, 252, 159, 153, 153, 2, 252, 255, 255, 255, 3, 252, 255, 255, 255, 3 }; -/* m -> M */ static const uint8_t Font_TTHoves_Bold_upper_17_glyph_109[] = { 14, 12, 16, 1, 12, 252, 255, 7, 0, 176, 255, 159, 252, 255, 12, 0, 240, 255, 159, 252, 255, 31, 0, 245, 255, 159, 252, 255, 111, 0, 250, 255, 159, 252, 255, 191, 0, 254, 255, 159, 252, 158, 255, 64, 255, 247, 159, 252, 78, 255, 149, 255, 242, 159, 252, 14, 254, 235, 191, 241, 159, 252, 14, 249, 255, 95, 241, 159, 252, 14, 243, 255, 15, 241, 159, 252, 14, 224, 255, 10, 241, 159, 252, 14, 128, 255, 5, 241, 159 }; -/* n -> N */ static const uint8_t Font_TTHoves_Bold_upper_17_glyph_110[] = { 11, 12, 13, 1, 12, 252, 207, 0, 96, 255, 4, 252, 255, 4, 96, 255, 4, 252, 255, 12, 96, 255, 4, 252, 255, 79, 96, 255, 4, 252, 255, 207, 96, 255, 4, 252, 126, 255, 100, 255, 4, 252, 14, 254, 108, 255, 4, 252, 14, 246, 223, 255, 4, 252, 14, 208, 255, 255, 4, 252, 14, 80, 255, 255, 4, 252, 14, 0, 253, 255, 4, 252, 14, 0, 244, 255, 4 }; -/* o -> O */ static const uint8_t Font_TTHoves_Bold_upper_17_glyph_111[] = { 13, 12, 13, 0, 12, 0, 32, 201, 207, 25, 0, 0, 0, 245, 255, 255, 239, 4, 0, 32, 255, 223, 219, 255, 31, 0, 192, 255, 7, 0, 248, 175, 0, 240, 191, 0, 0, 208, 255, 0, 243, 127, 0, 0, 144, 255, 2, 243, 127, 0, 0, 144, 255, 2, 240, 191, 0, 0, 208, 255, 0, 192, 255, 6, 0, 248, 175, 0, 32, 255, 223, 218, 255, 31, 0, 0, 245, 255, 255, 239, 4, 0, 0, 32, 217, 207, 25, 0, 0 }; -/* p -> P */ static const uint8_t Font_TTHoves_Bold_upper_17_glyph_112[] = { 10, 12, 11, 1, 12, 252, 255, 255, 141, 0, 252, 255, 255, 255, 11, 252, 175, 186, 255, 79, 252, 14, 0, 246, 127, 252, 14, 0, 243, 159, 252, 14, 0, 249, 111, 252, 255, 255, 255, 47, 252, 255, 255, 255, 6, 252, 175, 170, 55, 0, 252, 14, 0, 0, 0, 252, 14, 0, 0, 0, 252, 14, 0, 0, 0 }; -/* q -> Q */ static const uint8_t Font_TTHoves_Bold_upper_17_glyph_113[] = { 13, 13, 13, 0, 12, 0, 32, 201, 207, 25, 0, 0, 0, 245, 255, 255, 239, 4, 0, 32, 255, 223, 219, 255, 31, 0, 192, 255, 7, 0, 248, 175, 0, 240, 191, 0, 0, 208, 255, 0, 243, 127, 0, 0, 144, 255, 2, 243, 127, 0, 0, 128, 255, 2, 240, 191, 0, 0, 192, 255, 0, 192, 255, 102, 255, 253, 175, 0, 32, 255, 207, 255, 255, 63, 0, 0, 245, 255, 255, 255, 9, 0, 0, 32, 217, 223, 253, 63, 0, 0, 0, 0, 0, 225, 239, 2 }; -/* r -> R */ static const uint8_t Font_TTHoves_Bold_upper_17_glyph_114[] = { 11, 12, 12, 1, 12, 252, 255, 255, 157, 0, 0, 252, 255, 255, 255, 12, 0, 252, 143, 152, 254, 95, 0, 252, 14, 0, 244, 159, 0, 252, 14, 0, 241, 175, 0, 252, 14, 0, 248, 143, 0, 252, 255, 255, 255, 47, 0, 252, 255, 255, 223, 3, 0, 252, 175, 255, 12, 0, 0, 252, 14, 250, 175, 0, 0, 252, 14, 176, 255, 9, 0, 252, 14, 0, 252, 159, 0 }; -/* s -> S */ static const uint8_t Font_TTHoves_Bold_upper_17_glyph_115[] = { 11, 12, 11, 0, 12, 0, 180, 254, 157, 1, 0, 96, 255, 255, 255, 47, 0, 240, 255, 121, 252, 207, 0, 243, 159, 0, 192, 255, 0, 241, 239, 54, 0, 0, 0, 144, 255, 255, 207, 6, 0, 0, 181, 254, 255, 159, 0, 0, 0, 16, 229, 255, 0, 246, 95, 0, 144, 255, 2, 242, 255, 104, 248, 239, 0, 112, 255, 255, 255, 95, 0, 0, 179, 253, 173, 3, 0 }; -/* t -> T */ static const uint8_t Font_TTHoves_Bold_upper_17_glyph_116[] = { 10, 12, 10, 0, 12, 250, 255, 255, 255, 175, 250, 255, 255, 255, 175, 166, 202, 255, 172, 122, 0, 80, 255, 5, 0, 0, 80, 255, 5, 0, 0, 80, 255, 5, 0, 0, 80, 255, 5, 0, 0, 80, 255, 5, 0, 0, 80, 255, 5, 0, 0, 80, 255, 5, 0, 0, 80, 255, 5, 0, 0, 80, 255, 5, 0 }; -/* u -> U */ static const uint8_t Font_TTHoves_Bold_upper_17_glyph_117[] = { 11, 12, 12, 1, 12, 254, 12, 0, 144, 255, 1, 254, 12, 0, 144, 255, 1, 254, 12, 0, 144, 255, 1, 254, 12, 0, 144, 255, 1, 254, 12, 0, 144, 255, 1, 254, 12, 0, 144, 255, 1, 254, 13, 0, 144, 255, 1, 252, 14, 0, 176, 255, 0, 250, 111, 0, 243, 223, 0, 244, 255, 188, 255, 127, 0, 144, 255, 255, 255, 12, 0, 0, 180, 238, 124, 0, 0 }; -/* v -> V */ static const uint8_t Font_TTHoves_Bold_upper_17_glyph_118[] = { 12, 12, 12, 0, 12, 253, 47, 0, 0, 246, 143, 248, 127, 0, 0, 251, 63, 243, 207, 0, 16, 255, 14, 208, 255, 1, 80, 255, 9, 128, 255, 6, 160, 255, 4, 48, 255, 11, 240, 239, 0, 0, 254, 15, 244, 159, 0, 0, 248, 95, 250, 79, 0, 0, 243, 207, 254, 14, 0, 0, 224, 255, 255, 9, 0, 0, 144, 255, 255, 4, 0, 0, 64, 255, 255, 0, 0 }; -/* w -> W */ static const uint8_t Font_TTHoves_Bold_upper_17_glyph_119[] = { 17, 12, 17, 0, 12, 252, 47, 0, 242, 255, 0, 80, 255, 9, 248, 111, 0, 246, 255, 3, 144, 255, 5, 245, 159, 0, 250, 255, 7, 192, 255, 2, 241, 223, 0, 254, 255, 11, 240, 239, 0, 208, 255, 33, 255, 255, 15, 244, 175, 0, 144, 255, 100, 255, 246, 63, 247, 111, 0, 80, 255, 168, 223, 240, 127, 251, 47, 0, 16, 255, 253, 159, 192, 223, 255, 14, 0, 0, 254, 255, 95, 128, 255, 255, 10, 0, 0, 250, 255, 31, 64, 255, 255, 7, 0, 0, 246, 255, 13, 0, 255, 255, 3, 0, 0, 242, 255, 9, 0, 252, 255, 0, 0 }; -/* x -> X */ static const uint8_t Font_TTHoves_Bold_upper_17_glyph_120[] = { 13, 12, 12, 0, 12, 160, 255, 8, 0, 247, 191, 0, 16, 255, 47, 16, 255, 47, 0, 0, 246, 191, 160, 255, 7, 0, 0, 192, 255, 249, 207, 0, 0, 0, 32, 255, 255, 47, 0, 0, 0, 0, 248, 255, 8, 0, 0, 0, 0, 251, 255, 11, 0, 0, 0, 80, 255, 255, 95, 0, 0, 0, 225, 255, 245, 239, 1, 0, 0, 250, 143, 112, 255, 10, 0, 64, 255, 13, 0, 253, 95, 0, 224, 255, 4, 0, 244, 239, 1 }; -/* y -> Y */ static const uint8_t Font_TTHoves_Bold_upper_17_glyph_121[] = { 13, 12, 12, 0, 12, 225, 255, 1, 0, 242, 223, 0, 112, 255, 8, 0, 250, 95, 0, 0, 254, 31, 32, 255, 12, 0, 0, 246, 143, 160, 255, 4, 0, 0, 224, 255, 243, 207, 0, 0, 0, 96, 255, 255, 63, 0, 0, 0, 0, 253, 255, 11, 0, 0, 0, 0, 245, 255, 3, 0, 0, 0, 0, 224, 223, 0, 0, 0, 0, 0, 224, 207, 0, 0, 0, 0, 0, 224, 207, 0, 0, 0, 0, 0, 224, 207, 0, 0, 0 }; -/* z -> Z */ static const uint8_t Font_TTHoves_Bold_upper_17_glyph_122[] = { 10, 12, 11, 0, 12, 243, 255, 255, 255, 207, 243, 255, 255, 255, 207, 162, 170, 170, 255, 175, 0, 0, 144, 255, 30, 0, 0, 245, 255, 3, 0, 32, 255, 111, 0, 0, 209, 255, 9, 0, 0, 251, 207, 0, 0, 128, 255, 30, 0, 0, 243, 255, 156, 153, 137, 245, 255, 255, 255, 223, 245, 255, 255, 255, 223 }; /* { */ static const uint8_t Font_TTHoves_Bold_upper_17_glyph_123[] = { 7, 17, 7, 0, 13, 0, 16, 67, 0, 0, 245, 255, 1, 0, 254, 255, 1, 16, 255, 10, 0, 32, 255, 6, 0, 32, 255, 6, 0, 48, 255, 6, 0, 211, 255, 3, 0, 245, 110, 0, 0, 245, 175, 0, 0, 177, 255, 4, 0, 32, 255, 6, 0, 32, 255, 6, 0, 32, 255, 6, 0, 16, 255, 76, 0, 0, 253, 255, 1, 0, 178, 255, 1 }; /* | */ static const uint8_t Font_TTHoves_Bold_upper_17_glyph_124[] = { 3, 16, 7, 2, 12, 255, 9, 255, 9, 255, 9, 255, 9, 255, 9, 255, 9, 255, 9, 255, 9, 255, 9, 255, 9, 255, 9, 255, 9, 255, 9, 255, 9, 255, 9, 255, 9 }; /* } */ static const uint8_t Font_TTHoves_Bold_upper_17_glyph_125[] = { 7, 17, 7, 0, 13, 65, 3, 0, 0, 246, 223, 1, 0, 246, 255, 10, 0, 16, 254, 13, 0, 0, 251, 13, 0, 0, 251, 13, 0, 0, 251, 14, 0, 0, 248, 207, 0, 0, 128, 255, 0, 0, 210, 255, 0, 0, 249, 127, 0, 0, 251, 14, 0, 0, 251, 13, 0, 0, 251, 13, 0, 81, 255, 12, 0, 246, 255, 8, 0, 246, 158, 0, 0 }; @@ -172,32 +146,32 @@ const uint8_t * const Font_TTHoves_Bold_upper_17[126 + 1 - 32] = { Font_TTHoves_Bold_upper_17_glyph_94, Font_TTHoves_Bold_upper_17_glyph_95, Font_TTHoves_Bold_upper_17_glyph_96, - Font_TTHoves_Bold_upper_17_glyph_97, - Font_TTHoves_Bold_upper_17_glyph_98, - Font_TTHoves_Bold_upper_17_glyph_99, - Font_TTHoves_Bold_upper_17_glyph_100, - Font_TTHoves_Bold_upper_17_glyph_101, - Font_TTHoves_Bold_upper_17_glyph_102, - Font_TTHoves_Bold_upper_17_glyph_103, - Font_TTHoves_Bold_upper_17_glyph_104, - Font_TTHoves_Bold_upper_17_glyph_105, - Font_TTHoves_Bold_upper_17_glyph_106, - Font_TTHoves_Bold_upper_17_glyph_107, - Font_TTHoves_Bold_upper_17_glyph_108, - Font_TTHoves_Bold_upper_17_glyph_109, - Font_TTHoves_Bold_upper_17_glyph_110, - Font_TTHoves_Bold_upper_17_glyph_111, - Font_TTHoves_Bold_upper_17_glyph_112, - Font_TTHoves_Bold_upper_17_glyph_113, - Font_TTHoves_Bold_upper_17_glyph_114, - Font_TTHoves_Bold_upper_17_glyph_115, - Font_TTHoves_Bold_upper_17_glyph_116, - Font_TTHoves_Bold_upper_17_glyph_117, - Font_TTHoves_Bold_upper_17_glyph_118, - Font_TTHoves_Bold_upper_17_glyph_119, - Font_TTHoves_Bold_upper_17_glyph_120, - Font_TTHoves_Bold_upper_17_glyph_121, - Font_TTHoves_Bold_upper_17_glyph_122, + Font_TTHoves_Bold_upper_17_glyph_65, // a -> A + Font_TTHoves_Bold_upper_17_glyph_66, // b -> B + Font_TTHoves_Bold_upper_17_glyph_67, // c -> C + Font_TTHoves_Bold_upper_17_glyph_68, // d -> D + Font_TTHoves_Bold_upper_17_glyph_69, // e -> E + Font_TTHoves_Bold_upper_17_glyph_70, // f -> F + Font_TTHoves_Bold_upper_17_glyph_71, // g -> G + Font_TTHoves_Bold_upper_17_glyph_72, // h -> H + Font_TTHoves_Bold_upper_17_glyph_73, // i -> I + Font_TTHoves_Bold_upper_17_glyph_74, // j -> J + Font_TTHoves_Bold_upper_17_glyph_75, // k -> K + Font_TTHoves_Bold_upper_17_glyph_76, // l -> L + Font_TTHoves_Bold_upper_17_glyph_77, // m -> M + Font_TTHoves_Bold_upper_17_glyph_78, // n -> N + Font_TTHoves_Bold_upper_17_glyph_79, // o -> O + Font_TTHoves_Bold_upper_17_glyph_80, // p -> P + Font_TTHoves_Bold_upper_17_glyph_81, // q -> Q + Font_TTHoves_Bold_upper_17_glyph_82, // r -> R + Font_TTHoves_Bold_upper_17_glyph_83, // s -> S + Font_TTHoves_Bold_upper_17_glyph_84, // t -> T + Font_TTHoves_Bold_upper_17_glyph_85, // u -> U + Font_TTHoves_Bold_upper_17_glyph_86, // v -> V + Font_TTHoves_Bold_upper_17_glyph_87, // w -> W + Font_TTHoves_Bold_upper_17_glyph_88, // x -> X + Font_TTHoves_Bold_upper_17_glyph_89, // y -> Y + Font_TTHoves_Bold_upper_17_glyph_90, // z -> Z Font_TTHoves_Bold_upper_17_glyph_123, Font_TTHoves_Bold_upper_17_glyph_124, Font_TTHoves_Bold_upper_17_glyph_125, diff --git a/core/tools/codegen/gen_font.py b/core/tools/codegen/gen_font.py index 00d47b104..1cc291edf 100755 --- a/core/tools/codegen/gen_font.py +++ b/core/tools/codegen/gen_font.py @@ -227,13 +227,9 @@ class Glyph: bpp: int, i: int | str, static: bool = True, - map_from: str | None = None, ) -> str: numbers = ", ".join(str(n) for n in self.to_bytes(bpp)) - if map_from: - comment = f"/* {map_from} -> {self.char} */" - else: - comment = f"/* {self.char} */" + comment = f"/* {self.char} */" const_name = f"Font_{name_style_size}_glyph_{i}" if static: modifier = "static const" @@ -360,12 +356,9 @@ class FaceProcessor: def _write_c_file_content(self, f: TextIO) -> None: # Write "normal" ASCII characters for i in range(MIN_GLYPH, MAX_GLYPH + 1): - c = chr(i) - map_from = None - if c.islower() and self.only_upper: - map_from = c - c = c.upper() - self._write_char_definition(f, c, i, map_from=map_from) + if self.only_upper and self._is_lower_case(i): + continue + self._write_char_definition(f, chr(i), i) # Write non-printable character f.write("\n") @@ -379,18 +372,19 @@ class FaceProcessor: % (self._name_style_size, MAX_GLYPH, MIN_GLYPH) ) for i in range(MIN_GLYPH, MAX_GLYPH + 1): - f.write(" Font_%s_glyph_%d,\n" % (self._name_style_size, i)) + comment = "" + if self.only_upper and self._is_lower_case(i): + c_from = chr(i) + i = self._to_upper_case(i) + comment = f" // {c_from} -> {chr(i)}" + f.write(f" Font_{self._name_style_size}_glyph_{i},{comment}\n") f.write("};\n") - def _write_char_definition( - self, f: TextIO, c: str, i: int, map_from: str | None = None - ) -> None: + def _write_char_definition(self, f: TextIO, c: str, i: int) -> None: self._load_char(c) glyph = Glyph.from_face(self.face, c, self.shaveX) glyph.print_metrics() - definition_line = glyph.get_definition_line( - self._name_style_size, self.bpp, i, map_from=map_from - ) + definition_line = glyph.get_definition_line(self._name_style_size, self.bpp, i) f.write(definition_line) # Update mix/max metrics @@ -446,6 +440,16 @@ class FaceProcessor: % (self._name_style_size) ) + def _is_lower_case(self, i: int) -> bool: + """Check if the integer i corresponds to an ASCII lower-case letter.""" + return 97 <= i <= 122 # ASCII values for 'a' to 'z' + + def _to_upper_case(self, i: int) -> int: + """Convert a lower-case letter ASCII integer to upper-case.""" + if self._is_lower_case(i): + return i - 32 + return i + if __name__ == "__main__": if len(sys.argv) > 1 and "width" in sys.argv[1]: