diff --git a/core/SConscript.bootloader b/core/SConscript.bootloader index 00529e0eb1..3a5ec2afe8 100644 --- a/core/SConscript.bootloader +++ b/core/SConscript.bootloader @@ -36,18 +36,24 @@ 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', 'DISC1', 'DISC2'): FONT_NORMAL='Font_TTHoves_Regular_21' FONT_DEMIBOLD='Font_TTHoves_Regular_21' - FONT_BOLD='Font_TTHoves_Bold_17' + FONT_BOLD='Font_TTHoves_Bold_17_upper' FONT_MONO='Font_TTHoves_Regular_21' FONT_BIG=None + FONT_NORMAL_UPPER=None + FONT_BOLD_UPPER='Font_TTHoves_Bold_17_upper' elif TREZOR_MODEL in ('T3T1',): FONT_NORMAL='Font_TTSatoshi_DemiBold_21' FONT_DEMIBOLD='Font_TTSatoshi_DemiBold_21' - FONT_BOLD='Font_TTHoves_Bold_17' + FONT_BOLD=None FONT_MONO='Font_TTSatoshi_DemiBold_21' FONT_BIG=None + FONT_NORMAL_UPPER=None + FONT_BOLD_UPPER='Font_TTHoves_Bold_17_upper' # modtrezorcrypto CCFLAGS_MOD += '-Wno-sequence-point ' @@ -114,6 +120,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 1835b93055..e5c41fd60b 100644 --- a/core/SConscript.bootloader_ci +++ b/core/SConscript.bootloader_ci @@ -34,18 +34,24 @@ 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',): 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 elif TREZOR_MODEL in ('T3T1',): FONT_NORMAL='Font_TTSatoshi_DemiBold_21' FONT_DEMIBOLD=None FONT_BOLD=None FONT_MONO='Font_RobotoMono_Medium_21' FONT_BIG=None + FONT_NORMAL_UPPER=None + FONT_BOLD_UPPER=None # modtrezorcrypto CCFLAGS_MOD += '-Wno-sequence-point ' @@ -106,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, CFLAGS='%s -DPRODUCTION=%s' % (ARGUMENTS.get('CFLAGS', ''), ARGUMENTS.get('PRODUCTION', '0')), diff --git a/core/SConscript.bootloader_emu b/core/SConscript.bootloader_emu index 22bbc26de0..1506c4197c 100644 --- a/core/SConscript.bootloader_emu +++ b/core/SConscript.bootloader_emu @@ -33,18 +33,24 @@ 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', 'DISC2'): FONT_NORMAL='Font_TTHoves_Regular_21' FONT_DEMIBOLD=None - FONT_BOLD='Font_TTHoves_Bold_17' + FONT_BOLD=None FONT_MONO=None FONT_BIG=None + FONT_NORMAL_UPPER=None + FONT_BOLD_UPPER='Font_TTHoves_Bold_17_upper' elif TREZOR_MODEL in ('T3T1',): FONT_NORMAL='Font_TTSatoshi_DemiBold_21' FONT_DEMIBOLD='Font_TTSatoshi_DemiBold_21' - FONT_BOLD='Font_TTHoves_Bold_17' + FONT_BOLD=None FONT_MONO='Font_TTSatoshi_DemiBold_21' FONT_BIG=None + FONT_NORMAL_UPPER=None + FONT_BOLD_UPPER='Font_TTHoves_Bold_17_upper' # modtrezorcrypto CCFLAGS_MOD += '-Wno-sequence-point ' @@ -164,6 +170,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 1f926fcba5..fa38b8b80d 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='Font_PixelOperator_Regular_8_upper' + FONT_BOLD_UPPER='Font_PixelOperator_Bold_8_upper' 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_17_upper' # 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 22a6626d03..481a1a48ef 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 4772d45a95..7259a28653 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 90fe0df537..4a8bb342ef 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_8_upper' + FONT_BOLD_UPPER='Font_PixelOperator_Bold_8_upper' 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_17_upper' # 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 85662585a1..59c69ff520 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 76b528ed9f..b40be71e19 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 108dd91999..2b897c7517 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_MONO_ENABLE -#define FONT_MAX_HEIGHT MAX_FONT_H(FONT_MONO_MAX_HEIGHT, FONT_MAX_HEIGHT_5) +#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 FONT_MAX_HEIGHT_5 +#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_7) +#else +#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 b88953b98a..220cfe8170 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 f636a74b44..b34f62bbb9 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 a8580a96cb..3e4b7adddf 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 844f6a2860..91d0b87ae4 100644 --- a/core/src/trezor/ui/layouts/tr/__init__.py +++ b/core/src/trezor/ui/layouts/tr/__init__.py @@ -868,7 +868,10 @@ 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 36f4ded771..75f6a04c15 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_8_upper_cs.json", + "7_FONT_BOLD_UPPER": "font_pixeloperator_bold_8_upper_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_17_upper_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_17_upper_cs.json" } }, "header": { diff --git a/core/translations/de.json b/core/translations/de.json index e8595915ce..86c6ddf0b4 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_8_upper_de.json", + "7_FONT_BOLD_UPPER": "font_pixeloperator_bold_8_upper_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_17_upper_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_17_upper_de.json" } }, "header": { diff --git a/core/translations/es.json b/core/translations/es.json index ce7b8a1f07..cf4b06e4ce 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_8_upper_es.json", + "7_FONT_BOLD_UPPER": "font_pixeloperator_bold_8_upper_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_17_upper_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_17_upper_es.json" } }, "header": { diff --git a/core/translations/fr.json b/core/translations/fr.json index 8ddb5880bd..dd0b6e59ff 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_8_upper_fr.json", + "7_FONT_BOLD_UPPER": "font_pixeloperator_bold_8_upper_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_17_upper_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_17_upper_fr.json" } }, "header": {