1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-22 14:28:07 +00:00
trezor-firmware/legacy/gen/fonts.c

22 lines
485 B
C
Raw Normal View History

2014-04-29 12:26:51 +00:00
#include "fonts.h"
const uint8_t *const font_data[FONTS][128 - 32] = {
{
#include "font.inc"
},
#ifndef FONT_SKIP_FIXED
{
#include "fontfixed.inc"
},
#endif
2014-04-29 12:26:51 +00:00
};
int fontCharWidth(uint8_t font, uint8_t c) {
return (c < 0x20 || c >= 0x80) ? 0 : font_data[font % FONTS][c - 32][0];
}
2014-04-29 12:26:51 +00:00
const uint8_t *fontCharData(uint8_t font, uint8_t c) {
return (c < 0x20 || c >= 0x80) ? (const uint8_t *)""
: font_data[font % FONTS][c - 32] + 1;
2014-04-29 12:26:51 +00:00
}