feat(core): add fonts for T3T1

obrusvit/ui-t3t1-reset-device-apple-hotfix
Martin Milata 2 months ago committed by obrusvit
parent 4e5146b9bf
commit f3697f9aae

@ -40,18 +40,21 @@ if TREZOR_MODEL in ('R', ):
FONT_BOLD='Font_PixelOperator_Bold_8'
FONT_MONO='Font_PixelOperator_Regular_8'
FONT_BIG=None
FONT_SUB=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_MONO='Font_TTHoves_Regular_21'
FONT_BIG=None
FONT_SUB=None
elif TREZOR_MODEL in ('T3T1',):
FONT_NORMAL='Font_TTSatoshi_DemiBold_21'
FONT_DEMIBOLD='Font_TTSatoshi_DemiBold_21'
FONT_BOLD='Font_TTHoves_Bold_17'
FONT_MONO='Font_TTSatoshi_DemiBold_21'
FONT_BOLD='Font_TTSatoshi_DemiBold_21'
FONT_MONO='Font_RobotoMono_Medium_21'
FONT_BIG=None
FONT_SUB=None
# modtrezorcrypto
CCFLAGS_MOD += '-Wno-sequence-point '
@ -132,6 +135,7 @@ 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('SUB', FONT_SUB, CPPDEFINES_MOD, SOURCE_MOD)
env = Environment(
ENV=os.environ,

@ -35,18 +35,21 @@ if TREZOR_MODEL in ('1', 'R'):
FONT_BOLD=None
FONT_MONO='Font_PixelOperatorMono_Regular_8'
FONT_BIG=None
FONT_SUB=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_SUB=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_SUB=None
# modtrezorcrypto
CCFLAGS_MOD += '-Wno-sequence-point '
@ -107,6 +110,7 @@ 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('SUB', FONT_SUB, CPPDEFINES_MOD, SOURCE_MOD)
env = Environment(
ENV=os.environ, CFLAGS='%s -DPRODUCTION=%s' % (ARGUMENTS.get('CFLAGS', ''), ARGUMENTS.get('PRODUCTION', '0')),

@ -37,18 +37,21 @@ if TREZOR_MODEL in ('1', 'R'):
FONT_BOLD='Font_PixelOperator_Bold_8'
FONT_MONO='Font_PixelOperator_Regular_8'
FONT_BIG=None
FONT_SUB=None
elif TREZOR_MODEL in ('T', 'DISC2'):
FONT_NORMAL='Font_TTHoves_Regular_21'
FONT_DEMIBOLD=None
FONT_BOLD='Font_TTHoves_Bold_17'
FONT_MONO=None
FONT_BIG=None
FONT_SUB=None
elif TREZOR_MODEL in ('T3T1',):
FONT_NORMAL='Font_TTSatoshi_DemiBold_21'
FONT_DEMIBOLD='Font_TTSatoshi_DemiBold_21'
FONT_BOLD='Font_TTHoves_Bold_17'
FONT_MONO='Font_TTSatoshi_DemiBold_21'
FONT_BOLD='Font_TTSatoshi_DemiBold_21'
FONT_MONO='Font_RobotoMono_Medium_21'
FONT_BIG=None
FONT_SUB=None
# modtrezorcrypto
CCFLAGS_MOD += '-Wno-sequence-point '
@ -197,6 +200,7 @@ 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('SUB', FONT_SUB, CPPDEFINES_MOD, SOURCE_MOD)
env = Environment(ENV=os.environ, CFLAGS='%s -DCONFIDENTIAL= -DPRODUCTION=%s' % (ARGUMENTS.get('CFLAGS', ''), ARGUMENTS.get('PRODUCTION', '0')))

@ -45,12 +45,21 @@ if TREZOR_MODEL in ('1', 'R'):
FONT_BOLD='Font_PixelOperator_Bold_8'
FONT_MONO='Font_PixelOperatorMono_Regular_8'
FONT_BIG='Font_Unifont_Regular_16'
elif TREZOR_MODEL in ('T', 'T3T1', 'DISC1', 'DISC2'):
FONT_SUB=None
elif TREZOR_MODEL in ('T', 'DISC1', 'DISC2'):
FONT_NORMAL='Font_TTHoves_Regular_21'
FONT_DEMIBOLD='Font_TTHoves_DemiBold_21'
FONT_BOLD='Font_TTHoves_Bold_17'
FONT_MONO='Font_RobotoMono_Medium_20'
FONT_BIG=None
FONT_SUB=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='Font_TTSatoshi_DemiBold_42'
FONT_SUB='Font_TTSatoshi_DemiBold_18'
# modtrezorconfig
CPPPATH_MOD += [
@ -408,6 +417,7 @@ 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('SUB', FONT_SUB, CPPDEFINES_MOD, SOURCE_MOD)
SOURCE_QSTR = SOURCE_MOD + SOURCE_MICROPYTHON + SOURCE_MICROPYTHON_SPEED

@ -38,12 +38,21 @@ if TREZOR_MODEL in ('1', 'R'):
FONT_BOLD='Font_PixelOperator_Bold_8'
FONT_MONO=None
FONT_BIG=None
elif TREZOR_MODEL in ('T', 'T3T1'):
FONT_SUB=None
elif TREZOR_MODEL in ('T',):
FONT_NORMAL=None
FONT_DEMIBOLD=None
FONT_BOLD='Font_Roboto_Bold_20'
FONT_MONO=None
FONT_BIG=None
FONT_SUB=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_SUB=None
# modtrezorcrypto
CPPPATH_MOD += [
@ -100,6 +109,7 @@ 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('SUB', FONT_SUB, CPPDEFINES_MOD, SOURCE_MOD)
env = Environment(
ENV=os.environ,

@ -33,12 +33,21 @@ if TREZOR_MODEL in ('1', 'R'):
FONT_BOLD='Font_PixelOperator_Bold_8'
FONT_MONO=None
FONT_BIG=None
elif TREZOR_MODEL in ('T', 'T3T1'):
FONT_SUB=None
elif TREZOR_MODEL in ('T',):
FONT_NORMAL=None
FONT_DEMIBOLD=None
FONT_BOLD='Font_Roboto_Bold_20'
FONT_MONO=None
FONT_BIG=None
FONT_SUB=None
elif TREZOR_MODEL in ('T3T1',):
FONT_NORMAL=None
FONT_DEMIBOLD=None
FONT_BOLD='Font_TTSatoshi_DemiBold_21'
FONT_MONO=None
FONT_BIG=None
FONT_SUB=None
# modtrezorcrypto
CPPPATH_MOD += [
@ -74,6 +83,7 @@ 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('SUB', FONT_SUB, CPPDEFINES_MOD, SOURCE_MOD)
env = Environment(
ENV=os.environ,

@ -45,12 +45,21 @@ if TREZOR_MODEL in ('1', 'R'):
FONT_BOLD='Font_PixelOperator_Bold_8'
FONT_MONO='Font_PixelOperatorMono_Regular_8'
FONT_BIG='Font_Unifont_Regular_16'
elif TREZOR_MODEL in ('T', 'T3T1'):
FONT_SUB=None
elif TREZOR_MODEL in ('T',):
FONT_NORMAL='Font_TTHoves_Regular_21'
FONT_DEMIBOLD='Font_TTHoves_DemiBold_21'
FONT_BOLD='Font_TTHoves_Bold_17'
FONT_MONO='Font_RobotoMono_Medium_20'
FONT_BIG=None
FONT_SUB=None
elif TREZOR_MODEL in ('T3T1',):
FONT_NORMAL='Font_TTSatoshi_DemiBold_21'
FONT_DEMIBOLD='Font_TTSatoshi_DemiBold_21'
FONT_BOLD='Font_TTSatoshi_DemiBold_21'
FONT_MONO='Font_RobotoMono_Medium_21'
FONT_BIG='Font_TTSatoshi_DemiBold_42'
FONT_SUB='Font_TTSatoshi_DemiBold_18'
# modtrezorconfig
CPPPATH_MOD += [
@ -479,6 +488,7 @@ 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('SUB', FONT_SUB, CPPDEFINES_MOD, SOURCE_MOD)
SOURCE_QSTR = SOURCE_MOD + SOURCE_MICROPYTHON + SOURCE_UNIX

@ -49,6 +49,10 @@ int font_height(int font) {
#ifdef TREZOR_FONT_BIG_ENABLE
case FONT_BIG:
return FONT_BIG_HEIGHT;
#endif
#ifdef TREZOR_FONT_SUB_ENABLE
case FONT_SUB:
return FONT_SUB_HEIGHT;
#endif
}
return 0;
@ -75,6 +79,10 @@ int font_max_height(int font) {
#ifdef TREZOR_FONT_BIG_ENABLE
case FONT_BIG:
return FONT_BIG_MAX_HEIGHT;
#endif
#ifdef TREZOR_FONT_SUB_ENABLE
case FONT_SUB:
return FONT_SUB_MAX_HEIGHT;
#endif
}
return 0;
@ -101,6 +109,10 @@ int font_baseline(int font) {
#ifdef TREZOR_FONT_BIG_ENABLE
case FONT_BIG:
return FONT_BIG_BASELINE;
#endif
#ifdef TREZOR_FONT_SUB_ENABLE
case FONT_SUB:
return FONT_SUB_BASELINE;
#endif
}
return 0;
@ -199,6 +211,10 @@ const uint8_t *font_nonprintable_glyph(int font) {
#ifdef TREZOR_FONT_BIG_ENABLE
case FONT_BIG:
return NONPRINTABLE_GLYPH(FONT_BIG_DATA);
#endif
#ifdef TREZOR_FONT_SUB_ENABLE
case FONT_SUB:
return NONPRINTABLE_GLYPH(FONT_SUB_DATA);
#endif
default:
return NULL;
@ -240,6 +256,10 @@ const uint8_t *font_get_glyph(int font, uint16_t c) {
#ifdef TREZOR_FONT_BIG_ENABLE
case FONT_BIG:
return FONT_BIG_DATA[c - ' '];
#endif
#ifdef TREZOR_FONT_SUB_ENABLE
case FONT_SUB:
return FONT_SUB_DATA[c - ' '];
#endif
}
return 0;

@ -64,6 +64,15 @@
FONT_DEFINE(TREZOR_FONT_DEMIBOLD_ENABLE, _BASELINE)
#endif
#ifdef TREZOR_FONT_SUB_ENABLE
#include TREZOR_FONT_SUB_INCLUDE
#define FONT_SUB (-6)
#define FONT_SUB_DATA TREZOR_FONT_SUB_ENABLE
#define FONT_SUB_HEIGHT FONT_DEFINE(TREZOR_FONT_SUB_ENABLE, _HEIGHT)
#define FONT_SUB_MAX_HEIGHT FONT_DEFINE(TREZOR_FONT_SUB_ENABLE, _MAX_HEIGHT)
#define FONT_SUB_BASELINE FONT_DEFINE(TREZOR_FONT_SUB_ENABLE, _BASELINE)
#endif
#ifdef TREZOR_FONT_MONO_ENABLE
#include TREZOR_FONT_MONO_INCLUDE
#define FONT_MONO (-3)
@ -110,10 +119,16 @@
#define FONT_MAX_HEIGHT_5 FONT_MAX_HEIGHT_4
#endif
#ifdef TREZOR_FONT_SUB_ENABLE
#define FONT_MAX_HEIGHT_6 MAX_FONT_H(FONT_SUB_MAX_HEIGHT, FONT_MAX_HEIGHT_5)
#else
#define FONT_MAX_HEIGHT_6 FONT_MAX_HEIGHT_5
#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_6)
#else
#define FONT_MAX_HEIGHT FONT_MAX_HEIGHT_5
#define FONT_MAX_HEIGHT FONT_MAX_HEIGHT_6
#endif
int font_height(int font);

@ -154,6 +154,7 @@ pub enum Font {
MONO = 3,
BIG = 4,
DEMIBOLD = 5,
SUB = 6,
}
impl From<Font> for i32 {

@ -5,21 +5,24 @@
"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_SUB": null
},
"T2T1": {
"1_FONT_NORMAL": "font_tthoves_regular_21_cs.json",
"2_FONT_BOLD": "font_tthoves_bold_17_cs.json",
"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_SUB": null
},
"T3T1": {
"1_FONT_NORMAL": "font_tthoves_regular_21_cs.json",
"2_FONT_BOLD": "font_tthoves_bold_17_cs.json",
"3_FONT_MONO": "font_robotomono_medium_20_cs.json",
"4_FONT_BIG": null,
"5_FONT_DEMIBOLD": "font_tthoves_demibold_21_cs.json"
"1_FONT_NORMAL": "font_ttsatoshi_demibold_21_cs.json",
"2_FONT_BOLD": "font_ttsatoshi_demibold_21_cs.json",
"3_FONT_MONO": "font_robotomono_medium_21_cs.json",
"4_FONT_BIG": "font_ttsatoshi_demibold_42_cs.json",
"5_FONT_DEMIBOLD": "font_ttsatoshi_demibold_21_cs.json",
"6_FONT_SUB": "font_ttsatoshi_demibold_18_cs.json"
}
},
"header": {

@ -5,21 +5,24 @@
"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_SUB": null
},
"T2T1": {
"1_FONT_NORMAL": "font_tthoves_regular_21_de.json",
"2_FONT_BOLD": "font_tthoves_bold_17_de.json",
"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_SUB": null
},
"T3T1": {
"1_FONT_NORMAL": "font_tthoves_regular_21_de.json",
"2_FONT_BOLD": "font_tthoves_bold_17_de.json",
"3_FONT_MONO": "font_robotomono_medium_20_de.json",
"4_FONT_BIG": null,
"5_FONT_DEMIBOLD": "font_tthoves_demibold_21_de.json"
"1_FONT_NORMAL": "font_ttsatoshi_demibold_21_de.json",
"2_FONT_BOLD": "font_ttsatoshi_demibold_21_de.json",
"3_FONT_MONO": "font_robotomono_medium_21_de.json",
"4_FONT_BIG": "font_ttsatoshi_demibold_42_de.json",
"5_FONT_DEMIBOLD": "font_ttsatoshi_demibold_21_de.json",
"6_FONT_SUB": "font_ttsatoshi_demibold_18_de.json"
}
},
"header": {

@ -5,21 +5,24 @@
"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_SUB": null
},
"T2T1": {
"1_FONT_NORMAL": "font_tthoves_regular_21_es.json",
"2_FONT_BOLD": "font_tthoves_bold_17_es.json",
"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_SUB": null
},
"T3T1": {
"1_FONT_NORMAL": "font_tthoves_regular_21_es.json",
"2_FONT_BOLD": "font_tthoves_bold_17_es.json",
"3_FONT_MONO": "font_robotomono_medium_20_es.json",
"4_FONT_BIG": null,
"5_FONT_DEMIBOLD": "font_tthoves_demibold_21_es.json"
"1_FONT_NORMAL": "font_ttsatoshi_demibold_21_es.json",
"2_FONT_BOLD": "font_ttsatoshi_demibold_21_es.json",
"3_FONT_MONO": "font_robotomono_medium_21_es.json",
"4_FONT_BIG": "font_ttsatoshi_demibold_42_es.json",
"5_FONT_DEMIBOLD": "font_ttsatoshi_demibold_21_es.json",
"6_FONT_SUB": "font_ttsatoshi_demibold_18_es.json"
}
},
"header": {

@ -5,21 +5,24 @@
"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_SUB": null
},
"T2T1": {
"1_FONT_NORMAL": "font_tthoves_regular_21_fr.json",
"2_FONT_BOLD": "font_tthoves_bold_17_fr.json",
"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_SUB": null
},
"T3T1": {
"1_FONT_NORMAL": "font_tthoves_regular_21_fr.json",
"2_FONT_BOLD": "font_tthoves_bold_17_fr.json",
"3_FONT_MONO": "font_robotomono_medium_20_fr.json",
"4_FONT_BIG": null,
"5_FONT_DEMIBOLD": "font_tthoves_demibold_21_fr.json"
"1_FONT_NORMAL": "font_ttsatoshi_demibold_21_fr.json",
"2_FONT_BOLD": "font_ttsatoshi_demibold_21_fr.json",
"3_FONT_MONO": "font_robotomono_medium_21_fr.json",
"4_FONT_BIG": "font_ttsatoshi_demibold_42_fr.json",
"5_FONT_DEMIBOLD": "font_ttsatoshi_demibold_21_fr.json",
"6_FONT_SUB": "font_ttsatoshi_demibold_18_fr.json"
}
},
"header": {

@ -1,8 +1,8 @@
{
"current": {
"merkle_root": "83f62541670df59f347bfdf577f36c1ef504f769fd8a498c0f76aa78f9021cda",
"datetime": "2024-03-30T11:28:31.004037",
"commit": "1c36c0927c33fd05b4eff4b3a020940e33074b54"
"merkle_root": "bb6eb3feee5ec334a310bb083a1c4a84910bbaabc6808dec0ed0ab5831bab390",
"datetime": "2024-04-11T20:31:39.003670",
"commit": "fd71de0c950dfad73d0f783a6cbcb138f711d32c"
},
"history": [
{

Loading…
Cancel
Save