From bde7a99a8288a622be199abc460902da050f18f3 Mon Sep 17 00:00:00 2001 From: obrusvit Date: Tue, 9 Apr 2024 13:23:36 +0200 Subject: [PATCH] WIP - font put to SCons, C, Rust, tr jsons --- core/SConscript.bootloader | 6 +++ core/SConscript.bootloader_ci | 6 +++ core/SConscript.bootloader_emu | 6 +++ core/SConscript.firmware | 8 +++- core/SConscript.prodtest | 6 +++ core/SConscript.reflash | 6 +++ core/SConscript.unix | 8 +++- .../extmod/modtrezorui/modtrezorui-display.h | 4 +- core/embed/lib/fonts/fonts.c | 40 ++++++++++++++++++ core/embed/lib/fonts/fonts.h | 42 ++++++++++++++++++- core/embed/rust/src/ui/display/font.rs | 5 ++- core/mocks/generated/trezorui.pyi | 2 +- core/src/trezor/ui/__init__.py | 2 +- core/src/trezor/ui/layouts/tr/__init__.py | 2 +- core/translations/cs.json | 16 ++++--- core/translations/de.json | 16 ++++--- core/translations/es.json | 16 ++++--- core/translations/fr.json | 16 ++++--- 18 files changed, 177 insertions(+), 30 deletions(-) diff --git a/core/SConscript.bootloader b/core/SConscript.bootloader index 865ee532e..50eaad5d4 100644 --- a/core/SConscript.bootloader +++ b/core/SConscript.bootloader @@ -36,12 +36,16 @@ if TREZOR_MODEL in ('R', ): FONT_BOLD='Font_PixelOperator_Bold_8' FONT_MONO='Font_PixelOperator_Regular_8' FONT_BIG=None + FONT_NORMAL_UPPER=None + FONT_BOLD_UPPER=None elif TREZOR_MODEL in ('T', 'T3T1', 'DISC1', 'DISC2'): FONT_NORMAL='Font_TTHoves_Regular_21' FONT_DEMIBOLD='Font_TTHoves_Regular_21' FONT_BOLD='Font_TTHoves_Bold_17' FONT_MONO='Font_TTHoves_Regular_21' FONT_BIG=None + FONT_NORMAL_UPPER=None + FONT_BOLD_UPPER=None # modtrezorcrypto CCFLAGS_MOD += '-Wno-sequence-point ' @@ -108,6 +112,8 @@ tools.add_font('BOLD', FONT_BOLD, CPPDEFINES_MOD, SOURCE_MOD) tools.add_font('DEMIBOLD', FONT_DEMIBOLD, CPPDEFINES_MOD, SOURCE_MOD) tools.add_font('MONO', FONT_MONO, CPPDEFINES_MOD, SOURCE_MOD) tools.add_font('BIG', FONT_BIG, CPPDEFINES_MOD, SOURCE_MOD) +tools.add_font('NORMAL_UPPER', FONT_NORMAL_UPPER, CPPDEFINES_MOD, SOURCE_MOD) +tools.add_font('BOLD_UPPER', FONT_BOLD_UPPER, CPPDEFINES_MOD, SOURCE_MOD) env = Environment( ENV=os.environ, diff --git a/core/SConscript.bootloader_ci b/core/SConscript.bootloader_ci index 5b3038b48..0156894d5 100644 --- a/core/SConscript.bootloader_ci +++ b/core/SConscript.bootloader_ci @@ -34,12 +34,16 @@ if TREZOR_MODEL in ('1', 'R'): FONT_BOLD=None FONT_MONO='Font_PixelOperatorMono_Regular_8' FONT_BIG=None + FONT_NORMAL_UPPER=None + FONT_BOLD_UPPER=None elif TREZOR_MODEL in ('T', 'T3T1'): FONT_NORMAL='Font_Roboto_Regular_20' FONT_DEMIBOLD=None FONT_BOLD=None FONT_MONO='Font_RobotoMono_Medium_20' FONT_BIG=None + FONT_NORMAL_UPPER=None + FONT_BOLD_UPPER=None # modtrezorcrypto CCFLAGS_MOD += '-Wno-sequence-point ' @@ -100,6 +104,8 @@ tools.add_font('BOLD', FONT_BOLD, CPPDEFINES_MOD, SOURCE_MOD) tools.add_font('DEMIBOLD', FONT_DEMIBOLD, CPPDEFINES_MOD, SOURCE_MOD) tools.add_font('MONO', FONT_MONO, CPPDEFINES_MOD, SOURCE_MOD) tools.add_font('BIG', FONT_BIG, CPPDEFINES_MOD, SOURCE_MOD) +tools.add_font('NORMAL_UPPER', FONT_NORMAL_UPPER, CPPDEFINES_MOD, SOURCE_MOD) +tools.add_font('BOLD_UPPER', FONT_BOLD_UPPER, CPPDEFINES_MOD, SOURCE_MOD) env = Environment( ENV=os.environ, CFLAGS='%s -DPRODUCTION=%s' % (ARGUMENTS.get('CFLAGS', ''), ARGUMENTS.get('PRODUCTION', '0')), diff --git a/core/SConscript.bootloader_emu b/core/SConscript.bootloader_emu index 3c9763d26..3b5618603 100644 --- a/core/SConscript.bootloader_emu +++ b/core/SConscript.bootloader_emu @@ -33,12 +33,16 @@ if TREZOR_MODEL in ('1', 'R'): FONT_BOLD='Font_PixelOperator_Bold_8' FONT_MONO='Font_PixelOperator_Regular_8' FONT_BIG=None + FONT_NORMAL_UPPER=None + FONT_BOLD_UPPER=None elif TREZOR_MODEL in ('T', 'T3T1', 'DISC2'): FONT_NORMAL='Font_TTHoves_Regular_21' FONT_DEMIBOLD=None FONT_BOLD='Font_TTHoves_Bold_17' FONT_MONO=None FONT_BIG=None + FONT_NORMAL_UPPER=None + FONT_BOLD_UPPER=None # modtrezorcrypto CCFLAGS_MOD += '-Wno-sequence-point ' @@ -157,6 +161,8 @@ tools.add_font('BOLD', FONT_BOLD, CPPDEFINES_MOD, SOURCE_MOD) tools.add_font('DEMIBOLD', FONT_DEMIBOLD, CPPDEFINES_MOD, SOURCE_MOD) tools.add_font('MONO', FONT_MONO, CPPDEFINES_MOD, SOURCE_MOD) tools.add_font('BIG', FONT_BIG, CPPDEFINES_MOD, SOURCE_MOD) +tools.add_font('NORMAL_UPPER', FONT_NORMAL_UPPER, CPPDEFINES_MOD, SOURCE_MOD) +tools.add_font('BOLD_UPPER', FONT_BOLD_UPPER, CPPDEFINES_MOD, SOURCE_MOD) env = Environment(ENV=os.environ, CFLAGS='%s -DCONFIDENTIAL= -DPRODUCTION=%s' % (ARGUMENTS.get('CFLAGS', ''), ARGUMENTS.get('PRODUCTION', '0'))) diff --git a/core/SConscript.firmware b/core/SConscript.firmware index e7c6ea4cf..ef43f64b1 100644 --- a/core/SConscript.firmware +++ b/core/SConscript.firmware @@ -42,12 +42,16 @@ if TREZOR_MODEL in ('1', 'R'): FONT_BOLD='Font_PixelOperator_Bold_8' FONT_MONO='Font_PixelOperatorMono_Regular_8' FONT_BIG='Font_Unifont_Regular_16' + FONT_NORMAL_UPPER=None + FONT_BOLD_UPPER=None elif TREZOR_MODEL in ('T', 'T3T1', 'DISC1', 'DISC2'): FONT_NORMAL='Font_TTHoves_Regular_21' FONT_DEMIBOLD='Font_TTHoves_DemiBold_21' - FONT_BOLD='Font_TTHoves_Bold_17' + FONT_BOLD=None FONT_MONO='Font_RobotoMono_Medium_20' FONT_BIG=None + FONT_NORMAL_UPPER=None + FONT_BOLD_UPPER='Font_TTHoves_Bold_upper_17' # modtrezorconfig CPPPATH_MOD += [ @@ -391,6 +395,8 @@ tools.add_font('BOLD', FONT_BOLD, CPPDEFINES_MOD, SOURCE_MOD) tools.add_font('DEMIBOLD', FONT_DEMIBOLD, CPPDEFINES_MOD, SOURCE_MOD) tools.add_font('MONO', FONT_MONO, CPPDEFINES_MOD, SOURCE_MOD) tools.add_font('BIG', FONT_BIG, CPPDEFINES_MOD, SOURCE_MOD) +tools.add_font('NORMAL_UPPER', FONT_NORMAL_UPPER, CPPDEFINES_MOD, SOURCE_MOD) +tools.add_font('BOLD_UPPER', FONT_BOLD_UPPER, CPPDEFINES_MOD, SOURCE_MOD) SOURCE_QSTR = SOURCE_MOD + SOURCE_MICROPYTHON + SOURCE_MICROPYTHON_SPEED diff --git a/core/SConscript.prodtest b/core/SConscript.prodtest index 78d4320b9..441866519 100644 --- a/core/SConscript.prodtest +++ b/core/SConscript.prodtest @@ -38,12 +38,16 @@ if TREZOR_MODEL in ('1', 'R'): FONT_BOLD='Font_PixelOperator_Bold_8' FONT_MONO=None FONT_BIG=None + FONT_NORMAL_UPPER=None + FONT_BOLD_UPPER=None elif TREZOR_MODEL in ('T', 'T3T1'): FONT_NORMAL=None FONT_DEMIBOLD=None FONT_BOLD='Font_Roboto_Bold_20' FONT_MONO=None FONT_BIG=None + FONT_NORMAL_UPPER=None + FONT_BOLD_UPPER=None # modtrezorcrypto CPPPATH_MOD += [ @@ -100,6 +104,8 @@ tools.add_font('BOLD', FONT_BOLD, CPPDEFINES_MOD, SOURCE_MOD) tools.add_font('DEMIBOLD', FONT_DEMIBOLD, CPPDEFINES_MOD, SOURCE_MOD) tools.add_font('MONO', FONT_MONO, CPPDEFINES_MOD, SOURCE_MOD) tools.add_font('BIG', FONT_BIG, CPPDEFINES_MOD, SOURCE_MOD) +tools.add_font('NORMAL_UPPER', FONT_NORMAL_UPPER, CPPDEFINES_MOD, SOURCE_MOD) +tools.add_font('BOLD_UPPER', FONT_BOLD_UPPER, CPPDEFINES_MOD, SOURCE_MOD) env = Environment( ENV=os.environ, diff --git a/core/SConscript.reflash b/core/SConscript.reflash index 4772d45a9..7259a2865 100644 --- a/core/SConscript.reflash +++ b/core/SConscript.reflash @@ -33,12 +33,16 @@ if TREZOR_MODEL in ('1', 'R'): FONT_BOLD='Font_PixelOperator_Bold_8' FONT_MONO=None FONT_BIG=None + FONT_NORMAL_UPPER=None + FONT_BOLD_UPPER=None elif TREZOR_MODEL in ('T', 'T3T1'): FONT_NORMAL=None FONT_DEMIBOLD=None FONT_BOLD='Font_Roboto_Bold_20' FONT_MONO=None FONT_BIG=None + FONT_NORMAL_UPPER=None + FONT_BOLD_UPPER=None # modtrezorcrypto CPPPATH_MOD += [ @@ -74,6 +78,8 @@ tools.add_font('BOLD', FONT_BOLD, CPPDEFINES_MOD, SOURCE_MOD) tools.add_font('DEMIBOLD', FONT_DEMIBOLD, CPPDEFINES_MOD, SOURCE_MOD) tools.add_font('MONO', FONT_MONO, CPPDEFINES_MOD, SOURCE_MOD) tools.add_font('BIG', FONT_BIG, CPPDEFINES_MOD, SOURCE_MOD) +tools.add_font('NORMAL_UPPER', FONT_NORMAL_UPPER, CPPDEFINES_MOD, SOURCE_MOD) +tools.add_font('BOLD_UPPER', FONT_BOLD_UPPER, CPPDEFINES_MOD, SOURCE_MOD) env = Environment( ENV=os.environ, diff --git a/core/SConscript.unix b/core/SConscript.unix index 64f639bfe..68ed8d629 100644 --- a/core/SConscript.unix +++ b/core/SConscript.unix @@ -44,12 +44,16 @@ if TREZOR_MODEL in ('1', 'R'): FONT_BOLD='Font_PixelOperator_Bold_8' FONT_MONO='Font_PixelOperatorMono_Regular_8' FONT_BIG='Font_Unifont_Regular_16' + FONT_NORMAL_UPPER='Font_PixelOperator_Regular_upper_8' + FONT_BOLD_UPPER='Font_PixelOperator_Bold_upper_8' elif TREZOR_MODEL in ('T', 'T3T1'): FONT_NORMAL='Font_TTHoves_Regular_21' FONT_DEMIBOLD='Font_TTHoves_DemiBold_21' - FONT_BOLD='Font_TTHoves_Bold_17' + FONT_BOLD=None FONT_MONO='Font_RobotoMono_Medium_20' FONT_BIG=None + FONT_NORMAL_UPPER=None + FONT_BOLD_UPPER='Font_TTHoves_Bold_upper_17' # modtrezorconfig CPPPATH_MOD += [ @@ -441,6 +445,8 @@ tools.add_font('BOLD', FONT_BOLD, CPPDEFINES_MOD, SOURCE_MOD) tools.add_font('DEMIBOLD', FONT_DEMIBOLD, CPPDEFINES_MOD, SOURCE_MOD) tools.add_font('MONO', FONT_MONO, CPPDEFINES_MOD, SOURCE_MOD) tools.add_font('BIG', FONT_BIG, CPPDEFINES_MOD, SOURCE_MOD) +tools.add_font('NORMAL_UPPER', FONT_NORMAL_UPPER, CPPDEFINES_MOD, SOURCE_MOD) +tools.add_font('BOLD_UPPER', FONT_BOLD_UPPER, CPPDEFINES_MOD, SOURCE_MOD) SOURCE_QSTR = SOURCE_MOD + SOURCE_MICROPYTHON + SOURCE_UNIX diff --git a/core/embed/extmod/modtrezorui/modtrezorui-display.h b/core/embed/extmod/modtrezorui/modtrezorui-display.h index 85662585a..59c69ff52 100644 --- a/core/embed/extmod/modtrezorui/modtrezorui-display.h +++ b/core/embed/extmod/modtrezorui/modtrezorui-display.h @@ -28,8 +28,8 @@ /// HEIGHT: int # display height in pixels /// FONT_MONO: int # id of monospace font /// FONT_NORMAL: int # id of normal-width font -/// FONT_BOLD: int # id of bold-width font /// FONT_DEMIBOLD: int # id of demibold font +/// FONT_BOLD_UPPER: int # id of bold-width-uppercased font /// typedef struct _mp_obj_Display_t { mp_obj_base_t base; @@ -163,9 +163,9 @@ STATIC const mp_rom_map_elem_t mod_trezorui_Display_locals_dict_table[] = { {MP_ROM_QSTR(MP_QSTR_WIDTH), MP_ROM_INT(DISPLAY_RESX)}, {MP_ROM_QSTR(MP_QSTR_HEIGHT), MP_ROM_INT(DISPLAY_RESY)}, {MP_ROM_QSTR(MP_QSTR_FONT_NORMAL), MP_ROM_INT(FONT_NORMAL)}, - {MP_ROM_QSTR(MP_QSTR_FONT_BOLD), MP_ROM_INT(FONT_BOLD)}, {MP_ROM_QSTR(MP_QSTR_FONT_DEMIBOLD), MP_ROM_INT(FONT_DEMIBOLD)}, {MP_ROM_QSTR(MP_QSTR_FONT_MONO), MP_ROM_INT(FONT_MONO)}, + {MP_ROM_QSTR(MP_QSTR_FONT_BOLD_UPPER), MP_ROM_INT(FONT_BOLD_UPPER)}, }; STATIC MP_DEFINE_CONST_DICT(mod_trezorui_Display_locals_dict, mod_trezorui_Display_locals_dict_table); diff --git a/core/embed/lib/fonts/fonts.c b/core/embed/lib/fonts/fonts.c index 76b528ed9..2d6d60421 100644 --- a/core/embed/lib/fonts/fonts.c +++ b/core/embed/lib/fonts/fonts.c @@ -42,6 +42,14 @@ int font_height(int font) { case FONT_BOLD: return FONT_BOLD_HEIGHT; #endif +#ifdef TREZOR_FONT_NORMAL_UPPER_ENABLE + case FONT_NORMAL_UPPER: + return FONT_NORMAL_UPPER_HEIGHT; +#endif +#ifdef TREZOR_FONT_BOLD_UPPER_ENABLE + case FONT_BOLD_UPPER: + return FONT_BOLD_UPPER_HEIGHT; +#endif #ifdef TREZOR_FONT_MONO_ENABLE case FONT_MONO: return FONT_MONO_HEIGHT; @@ -68,6 +76,14 @@ int font_max_height(int font) { case FONT_BOLD: return FONT_BOLD_MAX_HEIGHT; #endif +#ifdef TREZOR_FONT_NORMAL_UPPER_ENABLE + case FONT_NORMAL_UPPER: + return FONT_NORMAL_UPPER_MAX_HEIGHT; +#endif +#ifdef TREZOR_FONT_BOLD_UPPER_ENABLE + case FONT_BOLD_UPPER: + return FONT_BOLD_UPPER_MAX_HEIGHT; +#endif #ifdef TREZOR_FONT_MONO_ENABLE case FONT_MONO: return FONT_MONO_MAX_HEIGHT; @@ -94,6 +110,14 @@ int font_baseline(int font) { case FONT_BOLD: return FONT_BOLD_BASELINE; #endif +#ifdef TREZOR_FONT_NORMAL_UPPER_ENABLE + case FONT_NORMAL_UPPER: + return FONT_NORMAL_UPPER_BASELINE; +#endif +#ifdef TREZOR_FONT_BOLD_UPPER_ENABLE + case FONT_BOLD_UPPER: + return FONT_BOLD_UPPER_BASELINE; +#endif #ifdef TREZOR_FONT_MONO_ENABLE case FONT_MONO: return FONT_MONO_BASELINE; @@ -192,6 +216,14 @@ const uint8_t *font_nonprintable_glyph(int font) { case FONT_BOLD: return NONPRINTABLE_GLYPH(FONT_BOLD_DATA); #endif +#ifdef TREZOR_FONT_NORMAL_UPPER_ENABLE + case FONT_NORMAL_UPPER: + return NONPRINTABLE_GLYPH(FONT_NORMAL_UPPER_DATA); +#endif +#ifdef TREZOR_FONT_BOLD_UPPER_ENABLE + case FONT_BOLD_UPPER: + return NONPRINTABLE_GLYPH(FONT_BOLD_UPPER_DATA); +#endif #ifdef TREZOR_FONT_MONO_ENABLE case FONT_MONO: return NONPRINTABLE_GLYPH(FONT_MONO_DATA); @@ -233,6 +265,14 @@ const uint8_t *font_get_glyph(int font, uint16_t c) { case FONT_BOLD: return FONT_BOLD_DATA[c - ' ']; #endif +#ifdef TREZOR_FONT_NORMAL_UPPER_ENABLE + case FONT_NORMAL_UPPER: + return FONT_NORMAL_UPPER_DATA[c - ' '];; +#endif +#ifdef TREZOR_FONT_BOLD_UPPER_ENABLE + case FONT_BOLD_UPPER: + return FONT_BOLD_UPPER_DATA[c - ' '];; +#endif #ifdef TREZOR_FONT_MONO_ENABLE case FONT_MONO: return FONT_MONO_DATA[c - ' ']; diff --git a/core/embed/lib/fonts/fonts.h b/core/embed/lib/fonts/fonts.h index 108dd9199..2b897c751 100644 --- a/core/embed/lib/fonts/fonts.h +++ b/core/embed/lib/fonts/fonts.h @@ -82,6 +82,30 @@ #define FONT_BOLD_BASELINE FONT_DEFINE(TREZOR_FONT_BOLD_ENABLE, _BASELINE) #endif +#ifdef TREZOR_FONT_NORMAL_UPPER_ENABLE +#include TREZOR_FONT_NORMAL_UPPER_INCLUDE +#define FONT_NORMAL_UPPER (-6) +#define FONT_NORMAL_UPPER_DATA TREZOR_FONT_NORMAL_UPPER_ENABLE +#define FONT_NORMAL_UPPER_HEIGHT \ + FONT_DEFINE(TREZOR_FONT_NORMAL_UPPER_ENABLE, _HEIGHT) +#define FONT_NORMAL_UPPER_MAX_HEIGHT \ + FONT_DEFINE(TREZOR_FONT_NORMAL_UPPER_ENABLE, _MAX_HEIGHT) +#define FONT_NORMAL_UPPER_BASELINE \ + FONT_DEFINE(TREZOR_FONT_NORMAL_UPPER_ENABLE, _BASELINE) +#endif + +#ifdef TREZOR_FONT_BOLD_UPPER_ENABLE +#include TREZOR_FONT_BOLD_UPPER_INCLUDE +#define FONT_BOLD_UPPER (-7) +#define FONT_BOLD_UPPER_DATA TREZOR_FONT_BOLD_UPPER_ENABLE +#define FONT_BOLD_UPPER_HEIGHT \ + FONT_DEFINE(TREZOR_FONT_BOLD_UPPER_ENABLE, _HEIGHT) +#define FONT_BOLD_UPPER_MAX_HEIGHT \ + FONT_DEFINE(TREZOR_FONT_BOLD_UPPER_ENABLE, _MAX_HEIGHT) +#define FONT_BOLD_UPPER_BASELINE \ + FONT_DEFINE(TREZOR_FONT_BOLD_UPPER_ENABLE, _BASELINE) +#endif + #define MAX_FONT_H(A, B) ((A) > (B) ? (A) : (B)) #define FONT_MAX_HEIGHT_1 0 @@ -110,10 +134,24 @@ #define FONT_MAX_HEIGHT_5 FONT_MAX_HEIGHT_4 #endif +#ifdef TREZOR_FONT_NORMAL_UPPER_ENABLE +#define FONT_MAX_HEIGHT_6 \ + MAX_FONT_H(FONT_NORMAL_UPPER_MAX_HEIGHT, FONT_MAX_HEIGHT_5) +#else +#define FONT_MAX_HEIGHT_6 FONT_MAX_HEIGHT_5 +#endif + +#ifdef TREZOR_FONT_BOLD_UPPER_ENABLE +#define FONT_MAX_HEIGHT_7 \ + MAX_FONT_H(FONT_BOLD_UPPER_MAX_HEIGHT, FONT_MAX_HEIGHT_6) +#else +#define FONT_MAX_HEIGHT_7 FONT_MAX_HEIGHT_6 +#endif + #ifdef TREZOR_FONT_MONO_ENABLE -#define FONT_MAX_HEIGHT MAX_FONT_H(FONT_MONO_MAX_HEIGHT, FONT_MAX_HEIGHT_5) +#define FONT_MAX_HEIGHT MAX_FONT_H(FONT_MONO_MAX_HEIGHT, FONT_MAX_HEIGHT_7) #else -#define FONT_MAX_HEIGHT FONT_MAX_HEIGHT_5 +#define FONT_MAX_HEIGHT FONT_MAX_HEIGHT_7 #endif int font_height(int font); diff --git a/core/embed/rust/src/ui/display/font.rs b/core/embed/rust/src/ui/display/font.rs index e6ad0f362..8dac6c076 100644 --- a/core/embed/rust/src/ui/display/font.rs +++ b/core/embed/rust/src/ui/display/font.rs @@ -122,15 +122,18 @@ impl Glyph { } /// Font constants. Keep in sync with FONT_ definitions in -/// `extmod/modtrezorui/fonts/fonts.h`. +/// `core/embed/lib/fonts/fonts.h`. #[derive(Copy, Clone, PartialEq, Eq, FromPrimitive)] #[repr(u8)] +#[allow(non_camel_case_types)] pub enum Font { NORMAL = 1, BOLD = 2, MONO = 3, BIG = 4, DEMIBOLD = 5, + NORMAL_UPPER = 6, + BOLD_UPPER = 7, } impl From for i32 { diff --git a/core/mocks/generated/trezorui.pyi b/core/mocks/generated/trezorui.pyi index f636a74b4..b34f62bbb 100644 --- a/core/mocks/generated/trezorui.pyi +++ b/core/mocks/generated/trezorui.pyi @@ -10,8 +10,8 @@ class Display: HEIGHT: int # display height in pixels FONT_MONO: int # id of monospace font FONT_NORMAL: int # id of normal-width font - FONT_BOLD: int # id of bold-width font FONT_DEMIBOLD: int # id of demibold font + FONT_BOLD_UPPER: int # id of bold-width-uppercased font def __init__(self) -> None: """ diff --git a/core/src/trezor/ui/__init__.py b/core/src/trezor/ui/__init__.py index 109ed105b..d89af6234 100644 --- a/core/src/trezor/ui/__init__.py +++ b/core/src/trezor/ui/__init__.py @@ -21,8 +21,8 @@ display = Display() # re-export constants from modtrezorui NORMAL: int = Display.FONT_NORMAL -BOLD: int = Display.FONT_BOLD DEMIBOLD: int = Display.FONT_DEMIBOLD +BOLD_UPPER: int = Display.FONT_BOLD_UPPER MONO: int = Display.FONT_MONO WIDTH: int = Display.WIDTH HEIGHT: int = Display.HEIGHT diff --git a/core/src/trezor/ui/layouts/tr/__init__.py b/core/src/trezor/ui/layouts/tr/__init__.py index f99cc9487..e84e36857 100644 --- a/core/src/trezor/ui/layouts/tr/__init__.py +++ b/core/src/trezor/ui/layouts/tr/__init__.py @@ -868,7 +868,7 @@ async def _confirm_ask_pagination( trezorui2.confirm_more( title=title, button=TR.buttons__go_back, - items=[(ui.BOLD, f"Size: {len(data)} bytes"), (ui.MONO, data)], + items=[(ui.BOLD_UPPER, f"Size: {len(data)} bytes"), (ui.MONO, data)], ) ) else: diff --git a/core/translations/cs.json b/core/translations/cs.json index 550fe6082..a34f2ecd1 100644 --- a/core/translations/cs.json +++ b/core/translations/cs.json @@ -5,21 +5,27 @@ "2_FONT_BOLD": "font_pixeloperator_bold_8_cs.json", "3_FONT_MONO": "font_pixeloperatormono_regular_8_cs.json", "4_FONT_BIG": "font_unifont_regular_16_cs.json", - "5_FONT_DEMIBOLD": "font_unifont_bold_16_cs.json" + "5_FONT_DEMIBOLD": "font_unifont_bold_16_cs.json", + "6_FONT_NORMAL_UPPER": "font_pixeloperator_regular_upper_8_cs.json", + "7_FONT_BOLD_UPPER": "font_pixeloperator_bold_upper_8_cs.json" }, "T2T1": { "1_FONT_NORMAL": "font_tthoves_regular_21_cs.json", - "2_FONT_BOLD": "font_tthoves_bold_17_cs.json", + "2_FONT_BOLD": null, "3_FONT_MONO": "font_robotomono_medium_20_cs.json", "4_FONT_BIG": null, - "5_FONT_DEMIBOLD": "font_tthoves_demibold_21_cs.json" + "5_FONT_DEMIBOLD": "font_tthoves_demibold_21_cs.json", + "6_FONT_NORMAL_UPPER": null, + "7_FONT_BOLD_UPPER": "font_tthoves_bold_upper_17_cs.json" }, "T3T1": { "1_FONT_NORMAL": "font_tthoves_regular_21_cs.json", - "2_FONT_BOLD": "font_tthoves_bold_17_cs.json", + "2_FONT_BOLD": null, "3_FONT_MONO": "font_robotomono_medium_20_cs.json", "4_FONT_BIG": null, - "5_FONT_DEMIBOLD": "font_tthoves_demibold_21_cs.json" + "5_FONT_DEMIBOLD": "font_tthoves_demibold_21_cs.json", + "6_FONT_NORMAL_UPPER": null, + "7_FONT_BOLD_UPPER": "font_tthoves_bold_upper_17_cs.json" } }, "header": { diff --git a/core/translations/de.json b/core/translations/de.json index 417f3c86e..4254de60f 100644 --- a/core/translations/de.json +++ b/core/translations/de.json @@ -5,21 +5,27 @@ "2_FONT_BOLD": "font_pixeloperator_bold_8_de.json", "3_FONT_MONO": "font_pixeloperatormono_regular_8_de.json", "4_FONT_BIG": "font_unifont_regular_16_de.json", - "5_FONT_DEMIBOLD": "font_unifont_bold_16_de.json" + "5_FONT_DEMIBOLD": "font_unifont_bold_16_de.json", + "6_FONT_NORMAL_UPPER": "font_pixeloperator_regular_upper_8_de.json", + "7_FONT_BOLD_UPPER": "font_pixeloperator_bold_upper_8_de.json" }, "T2T1": { "1_FONT_NORMAL": "font_tthoves_regular_21_de.json", - "2_FONT_BOLD": "font_tthoves_bold_17_de.json", + "2_FONT_BOLD": null, "3_FONT_MONO": "font_robotomono_medium_20_de.json", "4_FONT_BIG": null, - "5_FONT_DEMIBOLD": "font_tthoves_demibold_21_de.json" + "5_FONT_DEMIBOLD": "font_tthoves_demibold_21_de.json", + "6_FONT_NORMAL_UPPER": null, + "7_FONT_BOLD_UPPER": "font_tthoves_bold_upper_17_de.json" }, "T3T1": { "1_FONT_NORMAL": "font_tthoves_regular_21_de.json", - "2_FONT_BOLD": "font_tthoves_bold_17_de.json", + "2_FONT_BOLD": null, "3_FONT_MONO": "font_robotomono_medium_20_de.json", "4_FONT_BIG": null, - "5_FONT_DEMIBOLD": "font_tthoves_demibold_21_de.json" + "5_FONT_DEMIBOLD": "font_tthoves_demibold_21_de.json", + "6_FONT_NORMAL_UPPER": null, + "7_FONT_BOLD_UPPER": "font_tthoves_bold_upper_17_de.json" } }, "header": { diff --git a/core/translations/es.json b/core/translations/es.json index 179fb9e48..f0f6f8d51 100644 --- a/core/translations/es.json +++ b/core/translations/es.json @@ -5,21 +5,27 @@ "2_FONT_BOLD": "font_pixeloperator_bold_8_es.json", "3_FONT_MONO": "font_pixeloperatormono_regular_8_es.json", "4_FONT_BIG": "font_unifont_regular_16_es.json", - "5_FONT_DEMIBOLD": "font_unifont_bold_16_es.json" + "5_FONT_DEMIBOLD": "font_unifont_bold_16_es.json", + "6_FONT_NORMAL_UPPER": "font_pixeloperator_regular_upper_8_es.json", + "7_FONT_BOLD_UPPER": "font_pixeloperator_bold_upper_8_es.json" }, "T2T1": { "1_FONT_NORMAL": "font_tthoves_regular_21_es.json", - "2_FONT_BOLD": "font_tthoves_bold_17_es.json", + "2_FONT_BOLD": null, "3_FONT_MONO": "font_robotomono_medium_20_es.json", "4_FONT_BIG": null, - "5_FONT_DEMIBOLD": "font_tthoves_demibold_21_es.json" + "5_FONT_DEMIBOLD": "font_tthoves_demibold_21_es.json", + "6_FONT_NORMAL_UPPER": null, + "7_FONT_BOLD_UPPER": "font_tthoves_bold_upper_17_es.json" }, "T3T1": { "1_FONT_NORMAL": "font_tthoves_regular_21_es.json", - "2_FONT_BOLD": "font_tthoves_bold_17_es.json", + "2_FONT_BOLD": null, "3_FONT_MONO": "font_robotomono_medium_20_es.json", "4_FONT_BIG": null, - "5_FONT_DEMIBOLD": "font_tthoves_demibold_21_es.json" + "5_FONT_DEMIBOLD": "font_tthoves_demibold_21_es.json", + "6_FONT_NORMAL_UPPER": null, + "7_FONT_BOLD_UPPER": "font_tthoves_bold_upper_17_es.json" } }, "header": { diff --git a/core/translations/fr.json b/core/translations/fr.json index cec826076..2bdfd907f 100644 --- a/core/translations/fr.json +++ b/core/translations/fr.json @@ -5,21 +5,27 @@ "2_FONT_BOLD": "font_pixeloperator_bold_8_fr.json", "3_FONT_MONO": "font_pixeloperatormono_regular_8_fr.json", "4_FONT_BIG": "font_unifont_regular_16_fr.json", - "5_FONT_DEMIBOLD": "font_unifont_bold_16_fr.json" + "5_FONT_DEMIBOLD": "font_unifont_bold_16_fr.json", + "6_FONT_NORMAL_UPPER": "font_pixeloperator_regular_upper_8_fr.json", + "7_FONT_BOLD_UPPER": "font_pixeloperator_bold_upper_8_fr.json" }, "T2T1": { "1_FONT_NORMAL": "font_tthoves_regular_21_fr.json", - "2_FONT_BOLD": "font_tthoves_bold_17_fr.json", + "2_FONT_BOLD": null, "3_FONT_MONO": "font_robotomono_medium_20_fr.json", "4_FONT_BIG": null, - "5_FONT_DEMIBOLD": "font_tthoves_demibold_21_fr.json" + "5_FONT_DEMIBOLD": "font_tthoves_demibold_21_fr.json", + "6_FONT_NORMAL_UPPER": null, + "7_FONT_BOLD_UPPER": "font_tthoves_bold_upper_17_fr.json" }, "T3T1": { "1_FONT_NORMAL": "font_tthoves_regular_21_fr.json", - "2_FONT_BOLD": "font_tthoves_bold_17_fr.json", + "2_FONT_BOLD": null, "3_FONT_MONO": "font_robotomono_medium_20_fr.json", "4_FONT_BIG": null, - "5_FONT_DEMIBOLD": "font_tthoves_demibold_21_fr.json" + "5_FONT_DEMIBOLD": "font_tthoves_demibold_21_fr.json", + "6_FONT_NORMAL_UPPER": null, + "7_FONT_BOLD_UPPER": "font_tthoves_bold_upper_17_fr.json" } }, "header": {