mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-23 14:58:09 +00:00
feat(core): introduce FONT_BIG as a fifth optional font
[no changelog]
This commit is contained in:
parent
359f6709b0
commit
d199a17cfc
@ -33,11 +33,13 @@ if TREZOR_MODEL in ('R', ):
|
||||
FONT_DEMIBOLD='Font_PixelOperator_Regular_8'
|
||||
FONT_BOLD='Font_PixelOperator_Bold_8'
|
||||
FONT_MONO='Font_PixelOperator_Regular_8'
|
||||
if TREZOR_MODEL in ('T', ):
|
||||
FONT_BIG=None
|
||||
elif TREZOR_MODEL in ('T', ):
|
||||
FONT_NORMAL='Font_TTHoves_Regular_21'
|
||||
FONT_DEMIBOLD=None
|
||||
FONT_BOLD='Font_TTHoves_Bold_17'
|
||||
FONT_MONO=None
|
||||
FONT_BIG=None
|
||||
|
||||
# modtrezorcrypto
|
||||
CCFLAGS_MOD += '-Wno-sequence-point '
|
||||
@ -154,6 +156,7 @@ tools.add_font('NORMAL', FONT_NORMAL, CPPDEFINES_MOD, SOURCE_MOD)
|
||||
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)
|
||||
|
||||
env = Environment(ENV=os.environ, CFLAGS=f"{ARGUMENTS.get('CFLAGS', '')} -DPRODUCTION={int(PRODUCTION)} -DBOOTLOADER_QA={int(BOOTLOADER_QA)}")
|
||||
|
||||
|
@ -30,11 +30,13 @@ if TREZOR_MODEL in ('1', 'R'):
|
||||
FONT_DEMIBOLD=None
|
||||
FONT_BOLD=None
|
||||
FONT_MONO='Font_PixelOperatorMono_Regular_8'
|
||||
if TREZOR_MODEL in ('T', ):
|
||||
FONT_BIG=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
|
||||
|
||||
# modtrezorcrypto
|
||||
CCFLAGS_MOD += '-Wno-sequence-point '
|
||||
@ -138,6 +140,7 @@ tools.add_font('NORMAL', FONT_NORMAL, CPPDEFINES_MOD, SOURCE_MOD)
|
||||
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)
|
||||
|
||||
env = Environment(ENV=os.environ, CFLAGS='%s -DPRODUCTION=%s' % (ARGUMENTS.get('CFLAGS', ''), ARGUMENTS.get('PRODUCTION', '0')))
|
||||
|
||||
|
@ -32,11 +32,13 @@ if TREZOR_MODEL in ('1', 'R'):
|
||||
FONT_DEMIBOLD='Font_PixelOperator_Regular_8'
|
||||
FONT_BOLD='Font_PixelOperator_Bold_8'
|
||||
FONT_MONO='Font_PixelOperator_Regular_8'
|
||||
if TREZOR_MODEL in ('T', ):
|
||||
FONT_BIG=None
|
||||
elif TREZOR_MODEL in ('T', ):
|
||||
FONT_NORMAL='Font_TTHoves_Regular_21'
|
||||
FONT_DEMIBOLD=None
|
||||
FONT_BOLD='Font_TTHoves_Bold_17'
|
||||
FONT_MONO=None
|
||||
FONT_BIG=None
|
||||
|
||||
# modtrezorcrypto
|
||||
CCFLAGS_MOD += '-Wno-sequence-point '
|
||||
@ -119,6 +121,7 @@ tools.add_font('NORMAL', FONT_NORMAL, CPPDEFINES_MOD, SOURCE_MOD)
|
||||
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)
|
||||
|
||||
env = Environment(ENV=os.environ, CFLAGS='%s -DPRODUCTION=%s' % (ARGUMENTS.get('CFLAGS', ''), ARGUMENTS.get('PRODUCTION', '0')))
|
||||
|
||||
|
@ -34,11 +34,13 @@ if TREZOR_MODEL in ('R',):
|
||||
FONT_DEMIBOLD='Font_Unifont_Bold_16'
|
||||
FONT_BOLD='Font_PixelOperator_Bold_8'
|
||||
FONT_MONO='Font_PixelOperatorMono_Regular_8'
|
||||
if TREZOR_MODEL in ('T', ):
|
||||
FONT_BIG=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
|
||||
|
||||
# modtrezorconfig
|
||||
CPPPATH_MOD += [
|
||||
@ -418,6 +420,7 @@ tools.add_font('NORMAL', FONT_NORMAL, CPPDEFINES_MOD, SOURCE_MOD)
|
||||
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)
|
||||
|
||||
SOURCE_QSTR = SOURCE_MOD + SOURCE_MICROPYTHON + SOURCE_MICROPYTHON_SPEED
|
||||
|
||||
|
@ -20,11 +20,13 @@ if TREZOR_MODEL in ('1', 'R'):
|
||||
FONT_DEMIBOLD=None
|
||||
FONT_BOLD='Font_PixelOperator_Bold_8'
|
||||
FONT_MONO=None
|
||||
if TREZOR_MODEL in ('T', ):
|
||||
FONT_BIG=None
|
||||
elif TREZOR_MODEL in ('T', ):
|
||||
FONT_NORMAL=None
|
||||
FONT_DEMIBOLD=None
|
||||
FONT_BOLD='Font_Roboto_Bold_20'
|
||||
FONT_MONO=None
|
||||
FONT_BIG=None
|
||||
|
||||
# modtrezorcrypto
|
||||
CPPPATH_MOD += [
|
||||
@ -105,6 +107,7 @@ tools.add_font('NORMAL', FONT_NORMAL, CPPDEFINES_MOD, SOURCE_MOD)
|
||||
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)
|
||||
|
||||
env = Environment(ENV=os.environ, CFLAGS='%s -DPRODUCTION=%s' % (ARGUMENTS.get('CFLAGS', ''), ARGUMENTS.get('PRODUCTION', '0')))
|
||||
|
||||
|
@ -18,11 +18,13 @@ if TREZOR_MODEL in ('1', 'R'):
|
||||
FONT_DEMIBOLD=None
|
||||
FONT_BOLD='Font_PixelOperator_Bold_8'
|
||||
FONT_MONO=None
|
||||
if TREZOR_MODEL in ('T', ):
|
||||
FONT_BIG=None
|
||||
elif TREZOR_MODEL in ('T', ):
|
||||
FONT_NORMAL=None
|
||||
FONT_DEMIBOLD=None
|
||||
FONT_BOLD='Font_Roboto_Bold_20'
|
||||
FONT_MONO=None
|
||||
FONT_BIG=None
|
||||
|
||||
# modtrezorcrypto
|
||||
CPPPATH_MOD += [
|
||||
@ -96,6 +98,7 @@ tools.add_font('NORMAL', FONT_NORMAL, CPPDEFINES_MOD, SOURCE_MOD)
|
||||
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)
|
||||
|
||||
env = Environment(ENV=os.environ, CFLAGS='%s -DPRODUCTION=%s' % (ARGUMENTS.get('CFLAGS', ''), ARGUMENTS.get('PRODUCTION', '0')))
|
||||
|
||||
|
@ -30,11 +30,13 @@ if TREZOR_MODEL in ('R',):
|
||||
FONT_DEMIBOLD='Font_Unifont_Bold_16'
|
||||
FONT_BOLD='Font_PixelOperator_Bold_8'
|
||||
FONT_MONO='Font_PixelOperatorMono_Regular_8'
|
||||
if TREZOR_MODEL in ('T', ):
|
||||
FONT_BIG=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
|
||||
|
||||
# modtrezorconfig
|
||||
CPPPATH_MOD += [
|
||||
@ -374,6 +376,7 @@ tools.add_font('NORMAL', FONT_NORMAL, CPPDEFINES_MOD, SOURCE_MOD)
|
||||
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)
|
||||
|
||||
|
||||
SOURCE_QSTR = SOURCE_MOD + SOURCE_MICROPYTHON + SOURCE_UNIX
|
||||
|
@ -68,6 +68,10 @@ int font_height(int font) {
|
||||
#ifdef TREZOR_FONT_MONO_ENABLE
|
||||
case FONT_MONO:
|
||||
return FONT_MONO_HEIGHT;
|
||||
#endif
|
||||
#ifdef TREZOR_FONT_BIG_ENABLE
|
||||
case FONT_BIG:
|
||||
return FONT_BIG_HEIGHT;
|
||||
#endif
|
||||
}
|
||||
return 0;
|
||||
@ -90,6 +94,10 @@ int font_max_height(int font) {
|
||||
#ifdef TREZOR_FONT_MONO_ENABLE
|
||||
case FONT_MONO:
|
||||
return FONT_MONO_MAX_HEIGHT;
|
||||
#endif
|
||||
#ifdef TREZOR_FONT_BIG_ENABLE
|
||||
case FONT_BIG:
|
||||
return FONT_BIG_MAX_HEIGHT;
|
||||
#endif
|
||||
}
|
||||
return 0;
|
||||
@ -112,6 +120,10 @@ int font_baseline(int font) {
|
||||
#ifdef TREZOR_FONT_MONO_ENABLE
|
||||
case FONT_MONO:
|
||||
return FONT_MONO_BASELINE;
|
||||
#endif
|
||||
#ifdef TREZOR_FONT_BIG_ENABLE
|
||||
case FONT_BIG:
|
||||
return FONT_BIG_BASELINE;
|
||||
#endif
|
||||
}
|
||||
return 0;
|
||||
@ -139,6 +151,10 @@ const uint8_t *font_get_glyph(int font, uint8_t c) {
|
||||
#ifdef TREZOR_FONT_MONO_ENABLE
|
||||
case FONT_MONO:
|
||||
return FONT_MONO_DATA[c - ' '];
|
||||
#endif
|
||||
#ifdef TREZOR_FONT_BIG_ENABLE
|
||||
case FONT_BIG:
|
||||
return FONT_BIG_DATA[c - ' '];
|
||||
#endif
|
||||
}
|
||||
return 0;
|
||||
|
@ -45,6 +45,15 @@
|
||||
#define FONT_NORMAL_BASELINE FONT_DEFINE(TREZOR_FONT_NORMAL_ENABLE, _BASELINE)
|
||||
#endif
|
||||
|
||||
#ifdef TREZOR_FONT_BIG_ENABLE
|
||||
#include TREZOR_FONT_BIG_INCLUDE
|
||||
#define FONT_BIG (-4)
|
||||
#define FONT_BIG_DATA TREZOR_FONT_BIG_ENABLE
|
||||
#define FONT_BIG_HEIGHT FONT_DEFINE(TREZOR_FONT_BIG_ENABLE, _HEIGHT)
|
||||
#define FONT_BIG_MAX_HEIGHT FONT_DEFINE(TREZOR_FONT_BIG_ENABLE, _MAX_HEIGHT)
|
||||
#define FONT_BIG_BASELINE FONT_DEFINE(TREZOR_FONT_BIG_ENABLE, _BASELINE)
|
||||
#endif
|
||||
|
||||
#ifdef TREZOR_FONT_DEMIBOLD_ENABLE
|
||||
#include TREZOR_FONT_DEMIBOLD_INCLUDE
|
||||
#define FONT_DEMIBOLD (-5)
|
||||
@ -89,17 +98,23 @@
|
||||
#define FONT_MAX_HEIGHT_3 FONT_MAX_HEIGHT_2
|
||||
#endif
|
||||
|
||||
#ifdef TREZOR_FONT_DEMIBOLD_ENABLE
|
||||
#define FONT_MAX_HEIGHT_4 \
|
||||
MAX_FONT_H(FONT_DEMIBOLD_MAX_HEIGHT, FONT_MAX_HEIGHT_3)
|
||||
#ifdef TREZOR_FONT_BIG_ENABLE
|
||||
#define FONT_MAX_HEIGHT_4 MAX_FONT_H(FONT_BIG_MAX_HEIGHT, FONT_MAX_HEIGHT_3)
|
||||
#else
|
||||
#define FONT_MAX_HEIGHT_4 FONT_MAX_HEIGHT_3
|
||||
#endif
|
||||
|
||||
#ifdef TREZOR_FONT_MONO_ENABLE
|
||||
#define FONT_MAX_HEIGHT MAX_FONT_H(FONT_MONO_MAX_HEIGHT, FONT_MAX_HEIGHT_4)
|
||||
#ifdef TREZOR_FONT_DEMIBOLD_ENABLE
|
||||
#define FONT_MAX_HEIGHT_5 \
|
||||
MAX_FONT_H(FONT_DEMIBOLD_MAX_HEIGHT, FONT_MAX_HEIGHT_4)
|
||||
#else
|
||||
#define FONT_MAX_HEIGHT FONT_MAX_HEIGHT_4
|
||||
#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)
|
||||
#else
|
||||
#define FONT_MAX_HEIGHT FONT_MAX_HEIGHT_5
|
||||
#endif
|
||||
|
||||
int font_height(int font);
|
||||
|
@ -129,6 +129,7 @@ pub enum Font {
|
||||
NORMAL = 1,
|
||||
BOLD = 2,
|
||||
MONO = 3,
|
||||
BIG = 4,
|
||||
DEMIBOLD = 5,
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user