1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-16 11:28:14 +00:00

bootloader: disable usage of mono/normal fonts

This commit is contained in:
Pavol Rusnak 2017-04-28 15:54:54 +02:00
parent 8b0336862f
commit 97f95f44c0
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
4 changed files with 23 additions and 3 deletions

View File

@ -76,10 +76,12 @@ OBJ_BOOTLOADER += $(addprefix $(BUILD_FW)/, \
extmod/modtrezorui/inflate.o \
extmod/modtrezorui/font_bitmap.o \
extmod/modtrezorui/font_roboto_bold_20.o \
extmod/modtrezorui/font_roboto_regular_20.o \
extmod/modtrezorui/font_robotomono_regular_20.o \
)
CFLAGS_MOD += \
-DTREZOR_FONT_MONO_DISABLE=1 \
-DTREZOR_FONT_NORMAL_DISABLE=1 \
OBJ_TREZORHAL += $(addprefix $(BUILD_FW)/, \
trezorhal/common.o \
trezorhal/image.o \

View File

@ -42,7 +42,7 @@ void display_vendor(const uint8_t *vimg, const char *vstr, uint32_t vstr_len, ui
ver_str[3] += (fw_version >> 8) & 0xFF;
ver_str[5] += (fw_version >> 16) & 0xFF;
ver_str[7] += (fw_version >> 24) & 0xFF;
display_text_center(120, 215, ver_str, -1, FONT_NORMAL, 0x7BEF, 0x0000);
display_text_center(120, 215, ver_str, -1, FONT_BOLD, 0x7BEF, 0x0000);
display_refresh();
}

View File

@ -7,9 +7,15 @@
#include "inflate.h"
#include "font_bitmap.h"
#ifndef TREZOR_FONT_MONO_DISABLE
#include "font_robotomono_regular_20.h"
#endif
#ifndef TREZOR_FONT_NORMAL_DISABLE
#include "font_roboto_regular_20.h"
#endif
#ifndef TREZOR_FONT_BOLD_DISABLE
#include "font_roboto_bold_20.h"
#endif
#include "trezor-qrenc/qr_encode.h"
@ -218,12 +224,18 @@ static const uint8_t *get_glyph(uint8_t font, uint8_t c)
return 0;
}
switch (font) {
#ifndef TREZOR_FONT_MONO_DISABLE
case FONT_MONO:
return Font_RobotoMono_Regular_20[c - ' '];
#endif
#ifndef TREZOR_FONT_NORMAL_DISABLE
case FONT_NORMAL:
return Font_Roboto_Regular_20[c - ' '];
#endif
#ifndef TREZOR_FONT_BOLD_DISABLE
case FONT_BOLD:
return Font_Roboto_Bold_20[c - ' '];
#endif
}
return 0;
}

View File

@ -13,9 +13,15 @@
#define DISPLAY_RESX 240
#define DISPLAY_RESY 240
#ifndef TREZOR_FONT_MONO_DISABLE
#define FONT_MONO 0
#endif
#ifndef TREZOR_FONT_NORMAL_DISABLE
#define FONT_NORMAL 1
#endif
#ifndef TREZOR_FONT_BOLD_DISABLE
#define FONT_BOLD 2
#endif
#define LOADER_ICON_SIZE 64