mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-26 17:38:39 +00:00
119 lines
4.0 KiB
C
119 lines
4.0 KiB
C
#include "fonts.h"
|
|
|
|
const uint8_t *font_data[FONT_END - FONT_START + 1] = {
|
|
(uint8_t *)"\x01\x00",
|
|
(uint8_t *)"\x02\xfa\xfa",
|
|
(uint8_t *)"\x03\xc0\x00\xc0",
|
|
(uint8_t *)"\x05\x6c\xfe\x6c\xfe\x6c",
|
|
(uint8_t *)"\x05\x32\xff\x5a\xff\x4c",
|
|
(uint8_t *)"\x06\xc0\xc6\x1c\x70\xc6\x06",
|
|
(uint8_t *)"\x06\x5c\xfe\xb2\xfe\x4c\x1e",
|
|
(uint8_t *)"\x01\xc0",
|
|
(uint8_t *)"\x03\x3c\x7e\x81",
|
|
(uint8_t *)"\x03\x81\x7e\x3c",
|
|
(uint8_t *)"\x05\x6c\x38\xfe\x38\x6c",
|
|
(uint8_t *)"\x05\x10\x10\x7c\x10\x10",
|
|
(uint8_t *)"\x02\x03\x06",
|
|
(uint8_t *)"\x04\x10\x10\x10\x10",
|
|
(uint8_t *)"\x02\x06\x06",
|
|
(uint8_t *)"\x03\x0e\x38\xe0",
|
|
(uint8_t *)"\x05\x7c\xfe\x82\xfe\x7c",
|
|
(uint8_t *)"\x03\x40\xfe\xfe",
|
|
(uint8_t *)"\x05\x8e\x9e\x92\xf2\x62",
|
|
(uint8_t *)"\x05\x82\x92\x92\xfe\x6c",
|
|
(uint8_t *)"\x05\x18\x28\x48\xfe\xfe",
|
|
(uint8_t *)"\x05\xe2\xa2\xa2\xbe\x1c",
|
|
(uint8_t *)"\x05\x7c\xfe\xa2\xbe\x1c",
|
|
(uint8_t *)"\x05\x80\x8e\xbe\xf0\xc0",
|
|
(uint8_t *)"\x05\x6c\xfe\x92\xfe\x6c",
|
|
(uint8_t *)"\x05\x70\xfa\x8a\xfe\x7c",
|
|
(uint8_t *)"\x02\x36\x36",
|
|
(uint8_t *)"\x02\x33\x36",
|
|
(uint8_t *)"\x04\x10\x38\x6c\xc6",
|
|
(uint8_t *)"\x04\x28\x28\x28\x28",
|
|
(uint8_t *)"\x04\xc6\x6c\x38\x10",
|
|
(uint8_t *)"\x05\x80\x9a\xba\xe0\x40",
|
|
(uint8_t *)"\x06\x7c\xfe\xaa\xba\xfa\x78",
|
|
(uint8_t *)"\x05\x7e\xfe\x88\xfe\x7e",
|
|
(uint8_t *)"\x05\xfe\xfe\xa2\xfe\x5c",
|
|
(uint8_t *)"\x05\x7c\xfe\x82\x82\x82",
|
|
(uint8_t *)"\x05\xfe\xfe\x82\xfe\x7c",
|
|
(uint8_t *)"\x05\xfe\xfe\xa2\xa2\x82",
|
|
(uint8_t *)"\x05\xfe\xfe\xa0\xa0\x80",
|
|
(uint8_t *)"\x05\x7c\xfe\x82\x9e\x1e",
|
|
(uint8_t *)"\x05\xfe\xfe\x20\xfe\xfe",
|
|
(uint8_t *)"\x02\xfe\xfe",
|
|
(uint8_t *)"\x04\x02\x02\xfe\xfc",
|
|
(uint8_t *)"\x06\xfe\xfe\x38\x6c\xc6\x82",
|
|
(uint8_t *)"\x04\xfe\xfe\x02\x02",
|
|
(uint8_t *)"\x07\xfe\x7e\x30\x18\x30\x7e\xfe",
|
|
(uint8_t *)"\x06\xfe\x7e\x30\x18\xfc\xfe",
|
|
(uint8_t *)"\x06\x7c\xfe\x82\x82\xfe\x7c",
|
|
(uint8_t *)"\x05\xfe\xfe\x88\xf8\x70",
|
|
(uint8_t *)"\x06\x7c\xfe\x82\x86\xff\x7d",
|
|
(uint8_t *)"\x05\xfe\xfe\x88\xfe\x72",
|
|
(uint8_t *)"\x04\x62\xf2\x9e\x8c",
|
|
(uint8_t *)"\x06\x80\x80\xfe\xfe\x80\x80",
|
|
(uint8_t *)"\x05\xfc\xfe\x02\xfe\xfc",
|
|
(uint8_t *)"\x06\xe0\xf8\x1e\x1e\xf8\xe0",
|
|
(uint8_t *)"\x07\xf0\xfe\x1e\x3c\x1e\xfe\xf0",
|
|
(uint8_t *)"\x06\xc6\xee\x38\x38\xee\xc6",
|
|
(uint8_t *)"\x06\xc0\xe0\x3e\x3e\xe0\xc0",
|
|
(uint8_t *)"\x05\x8e\x9e\xba\xf2\xe2",
|
|
(uint8_t *)"\x03\xff\xff\x81",
|
|
(uint8_t *)"\x03\xe0\x38\x0e",
|
|
(uint8_t *)"\x03\x81\xff\xff",
|
|
(uint8_t *)"\x03\x60\xc0\x60",
|
|
(uint8_t *)"\x06\x02\x02\x02\x02\x02\x02",
|
|
(uint8_t *)"\x02\x80\x40",
|
|
(uint8_t *)"\x05\x04\x2e\x2a\x3e\x1e",
|
|
(uint8_t *)"\x05\xfe\xfe\x22\x3e\x1c",
|
|
(uint8_t *)"\x04\x1c\x3e\x22\x22",
|
|
(uint8_t *)"\x05\x1c\x3e\x22\xfe\xfe",
|
|
(uint8_t *)"\x05\x1c\x3e\x2a\x3a\x1a",
|
|
(uint8_t *)"\x03\x7e\xfe\xa0",
|
|
(uint8_t *)"\x05\x18\x3d\x25\x3f\x3e",
|
|
(uint8_t *)"\x05\xfe\xfe\x20\x3e\x1e",
|
|
(uint8_t *)"\x02\xbe\xbe",
|
|
(uint8_t *)"\x03\x01\xbf\xbe",
|
|
(uint8_t *)"\x05\xfe\xfe\x1c\x36\x22",
|
|
(uint8_t *)"\x02\xfe\xfe",
|
|
(uint8_t *)"\x08\x3e\x3e\x20\x3e\x3e\x20\x3e\x1e",
|
|
(uint8_t *)"\x05\x3e\x3e\x20\x3e\x1e",
|
|
(uint8_t *)"\x05\x1c\x3e\x22\x3e\x1c",
|
|
(uint8_t *)"\x05\x3f\x3f\x24\x3c\x18",
|
|
(uint8_t *)"\x05\x18\x3c\x24\x3f\x3f",
|
|
(uint8_t *)"\x04\x3e\x3e\x10\x30",
|
|
(uint8_t *)"\x04\x1a\x3a\x2e\x2c",
|
|
(uint8_t *)"\x03\xfc\xfe\x22",
|
|
(uint8_t *)"\x05\x3c\x3e\x02\x3e\x3e",
|
|
(uint8_t *)"\x05\x30\x3c\x0e\x3c\x30",
|
|
(uint8_t *)"\x07\x38\x3e\x06\x1c\x06\x3e\x38",
|
|
(uint8_t *)"\x05\x36\x3e\x08\x3e\x36",
|
|
(uint8_t *)"\x05\x38\x3d\x05\x3f\x3e",
|
|
(uint8_t *)"\x05\x26\x2e\x3a\x32\x22",
|
|
(uint8_t *)"\x07\x44\xee\x7c\x38\x7c\xee\x44",
|
|
(uint8_t *)"\x02\xff\xff",
|
|
(uint8_t *)"\x07\x18\x1c\x0e\x18\x30\x40\x80",
|
|
(uint8_t *)"\x06\x10\x38\x7c\x10\x10\x10",
|
|
(uint8_t *)"\x06\x10\x10\x10\x7c\x38\x10",
|
|
(uint8_t *)"\x05\x7e\xff\x52\xff\x2c",
|
|
};
|
|
|
|
int fontCharWidth(char c) {
|
|
if ((c < FONT_START) || (c > FONT_END)) {
|
|
c = '?';
|
|
}
|
|
return font_data[(int)(c - FONT_START)][0];
|
|
}
|
|
|
|
int fontStringWidth(const char *s) {
|
|
if (!s) return 0;
|
|
int l = 0;
|
|
char *c;
|
|
for (c = (char *)s; *c; c++) {
|
|
l += fontCharWidth(*c) + 1;
|
|
}
|
|
return l;
|
|
}
|