Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(core): simplify fonts handling #4194

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions core/embed/lib/buffers.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
#include "fonts/fonts.h"
#include "memzero.h"

const int32_t text_buffer_height = FONT_MAX_HEIGHT;
const int32_t buffer_width = DISPLAY_RESX;

#define CONCAT_(a, b) a##b
#define CONCAT(a, b) CONCAT_(a, b)

Expand Down
3 changes: 0 additions & 3 deletions core/embed/lib/buffers.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ typedef __attribute__((aligned(4))) struct {
uint16_t buffer[3][BUFFER_PIXELS];
} buffer_blurring_totals_t;

extern const int32_t text_buffer_height;
extern const int32_t buffer_width;

buffer_line_16bpp_t* buffers_get_line_16bpp(bool clear);
void buffers_free_line_16bpp(buffer_line_16bpp_t* buffer);

Expand Down
18 changes: 10 additions & 8 deletions core/embed/lib/display_draw.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void display_bar(int x, int y, int w, int h, uint16_t c) {
display_pixeldata_dirty();
}

void display_text_render_buffer(const char *text, int textlen, int font,
void display_text_render_buffer(const char *text, int textlen, font_id_t font,
buffer_text_t *buffer, int text_offset) {
// determine text length if not provided
if (textlen < 0) {
Expand Down Expand Up @@ -159,7 +159,8 @@ void display_text_render_buffer(const char *text, int textlen, int font,

#ifdef FRAMEBUFFER
static void display_text_render(int x, int y, const char *text, int textlen,
int font, uint16_t fgcolor, uint16_t bgcolor) {
font_id_t font, uint16_t fgcolor,
uint16_t bgcolor) {
// determine text length if not provided
if (textlen < 0) {
textlen = strlen(text);
Expand Down Expand Up @@ -226,7 +227,8 @@ static void display_text_render(int x, int y, const char *text, int textlen,

#else
static void display_text_render(int x, int y, const char *text, int textlen,
int font, uint16_t fgcolor, uint16_t bgcolor) {
font_id_t font, uint16_t fgcolor,
uint16_t bgcolor) {
// determine text length if not provided
if (textlen < 0) {
textlen = strlen(text);
Expand Down Expand Up @@ -282,23 +284,23 @@ static void display_text_render(int x, int y, const char *text, int textlen,
}
#endif

void display_text(int x, int y, const char *text, int textlen, int font,
void display_text(int x, int y, const char *text, int textlen, font_id_t font,
uint16_t fgcolor, uint16_t bgcolor) {
x += DISPLAY_OFFSET.x;
y += DISPLAY_OFFSET.y;
display_text_render(x, y, text, textlen, font, fgcolor, bgcolor);
}

void display_text_center(int x, int y, const char *text, int textlen, int font,
uint16_t fgcolor, uint16_t bgcolor) {
void display_text_center(int x, int y, const char *text, int textlen,
font_id_t font, uint16_t fgcolor, uint16_t bgcolor) {
x += DISPLAY_OFFSET.x;
y += DISPLAY_OFFSET.y;
int w = font_text_width(font, text, textlen);
display_text_render(x - w / 2, y, text, textlen, font, fgcolor, bgcolor);
}

void display_text_right(int x, int y, const char *text, int textlen, int font,
uint16_t fgcolor, uint16_t bgcolor) {
void display_text_right(int x, int y, const char *text, int textlen,
font_id_t font, uint16_t fgcolor, uint16_t bgcolor) {
x += DISPLAY_OFFSET.x;
y += DISPLAY_OFFSET.y;
int w = font_text_width(font, text, textlen);
Expand Down
12 changes: 6 additions & 6 deletions core/embed/lib/display_draw.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ void display_clear(void);

void display_bar(int x, int y, int w, int h, uint16_t c);

void display_text(int x, int y, const char *text, int textlen, int font,
void display_text(int x, int y, const char *text, int textlen, font_id_t font,
uint16_t fgcolor, uint16_t bgcolor);
void display_text_center(int x, int y, const char *text, int textlen, int font,
uint16_t fgcolor, uint16_t bgcolor);
void display_text_right(int x, int y, const char *text, int textlen, int font,
uint16_t fgcolor, uint16_t bgcolor);
void display_text_render_buffer(const char *text, int textlen, int font,
void display_text_center(int x, int y, const char *text, int textlen,
font_id_t font, uint16_t fgcolor, uint16_t bgcolor);
void display_text_right(int x, int y, const char *text, int textlen,
font_id_t font, uint16_t fgcolor, uint16_t bgcolor);
void display_text_render_buffer(const char *text, int textlen, font_id_t font,
buffer_text_t *buffer, int text_offset);

void display_qrcode(int x, int y, const char *data, uint8_t scale);
Expand Down
25 changes: 20 additions & 5 deletions core/embed/lib/fonts/font_pixeloperator_bold_8.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file is generated by core/tools/codegen/gen_font.py

#include <stdint.h>
#include "fonts_types.h"

// clang-format off

Expand Down Expand Up @@ -106,11 +107,9 @@
/* } */ static const uint8_t Font_PixelOperator_Bold_8_glyph_125[] = { 5, 7, 6, 0, 7, 225, 140, 51, 27, 128 };
/* ~ */ static const uint8_t Font_PixelOperator_Bold_8_glyph_126[] = { 7, 2, 8, 0, 7, 119, 184 };

/* ? */ const uint8_t Font_PixelOperator_Bold_8_glyph_nonprintable[] = { 6, 7, 7, 0, 7, 132, 207, 57, 207, 252, 255 };
/* ? */ static const uint8_t Font_PixelOperator_Bold_8_glyph_nonprintable[] = { 6, 7, 7, 0, 7, 132, 207, 57, 207, 252, 255 };

/* ? */ const uint8_t Font_PixelOperator_Bold_8_upper_glyph_nonprintable[] = { 6, 7, 7, 0, 7, 132, 207, 57, 207, 252, 255 };

const uint8_t * const Font_PixelOperator_Bold_8[126 + 1 - 32] = {
static const uint8_t * const Font_PixelOperator_Bold_8[126 + 1 - 32] = {
Font_PixelOperator_Bold_8_glyph_32,
Font_PixelOperator_Bold_8_glyph_33,
Font_PixelOperator_Bold_8_glyph_34,
Expand Down Expand Up @@ -208,7 +207,7 @@ const uint8_t * const Font_PixelOperator_Bold_8[126 + 1 - 32] = {
Font_PixelOperator_Bold_8_glyph_126,
};

const uint8_t * const Font_PixelOperator_Bold_8_upper[126 + 1 - 32] = {
static const uint8_t * const Font_PixelOperator_Bold_8_upper[126 + 1 - 32] = {
Font_PixelOperator_Bold_8_glyph_32,
Font_PixelOperator_Bold_8_glyph_33,
Font_PixelOperator_Bold_8_glyph_34,
Expand Down Expand Up @@ -305,3 +304,19 @@ const uint8_t * const Font_PixelOperator_Bold_8_upper[126 + 1 - 32] = {
Font_PixelOperator_Bold_8_glyph_125,
Font_PixelOperator_Bold_8_glyph_126,
};

const font_info_t Font_PixelOperator_Bold_8_info = {
.height = 8,
.max_height = 8,
.baseline = 1,
.glyph_data = Font_PixelOperator_Bold_8,
.glyph_nonprintable = Font_PixelOperator_Bold_8_glyph_nonprintable,
};

const font_info_t Font_PixelOperator_Bold_8_upper_info = {
.height = 8,
.max_height = 8,
.baseline = 1,
.glyph_data = Font_PixelOperator_Bold_8_upper,
.glyph_nonprintable = Font_PixelOperator_Bold_8_glyph_nonprintable,
};
12 changes: 4 additions & 8 deletions core/embed/lib/fonts/font_pixeloperator_bold_8.h
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
// This file is generated by core/tools/codegen/gen_font.py

#include <stdint.h>
#include "fonts_types.h"

#if TREZOR_FONT_BPP != 1
#error Wrong TREZOR_FONT_BPP (expected 1)
#endif
#define Font_PixelOperator_Bold_8_HEIGHT 8

#define Font_PixelOperator_Bold_8_MAX_HEIGHT 8
#define Font_PixelOperator_Bold_8_BASELINE 1
extern const uint8_t* const Font_PixelOperator_Bold_8[126 + 1 - 32];
extern const uint8_t Font_PixelOperator_Bold_8_glyph_nonprintable[];
#define Font_PixelOperator_Bold_8_upper_HEIGHT 8
extern const font_info_t Font_PixelOperator_Bold_8_info;
#define Font_PixelOperator_Bold_8_upper_MAX_HEIGHT 8
#define Font_PixelOperator_Bold_8_upper_BASELINE 1
extern const uint8_t* const Font_PixelOperator_Bold_8_upper[126 + 1 - 32];
extern const uint8_t Font_PixelOperator_Bold_8_upper_glyph_nonprintable[];
extern const font_info_t Font_PixelOperator_Bold_8_upper_info;
25 changes: 20 additions & 5 deletions core/embed/lib/fonts/font_pixeloperator_regular_8.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file is generated by core/tools/codegen/gen_font.py

#include <stdint.h>
#include "fonts_types.h"

// clang-format off

Expand Down Expand Up @@ -106,11 +107,9 @@
/* } */ static const uint8_t Font_PixelOperator_Regular_8_glyph_125[] = { 4, 7, 6, 0, 7, 194, 33, 34, 192 };
/* ~ */ static const uint8_t Font_PixelOperator_Regular_8_glyph_126[] = { 6, 2, 7, 0, 7, 102, 96 };

/* ? */ const uint8_t Font_PixelOperator_Regular_8_glyph_nonprintable[] = { 5, 7, 6, 0, 7, 139, 189, 221, 255, 127 };
/* ? */ static const uint8_t Font_PixelOperator_Regular_8_glyph_nonprintable[] = { 5, 7, 6, 0, 7, 139, 189, 221, 255, 127 };

/* ? */ const uint8_t Font_PixelOperator_Regular_8_upper_glyph_nonprintable[] = { 5, 7, 6, 0, 7, 139, 189, 221, 255, 127 };

const uint8_t * const Font_PixelOperator_Regular_8[126 + 1 - 32] = {
static const uint8_t * const Font_PixelOperator_Regular_8[126 + 1 - 32] = {
Font_PixelOperator_Regular_8_glyph_32,
Font_PixelOperator_Regular_8_glyph_33,
Font_PixelOperator_Regular_8_glyph_34,
Expand Down Expand Up @@ -208,7 +207,7 @@ const uint8_t * const Font_PixelOperator_Regular_8[126 + 1 - 32] = {
Font_PixelOperator_Regular_8_glyph_126,
};

const uint8_t * const Font_PixelOperator_Regular_8_upper[126 + 1 - 32] = {
static const uint8_t * const Font_PixelOperator_Regular_8_upper[126 + 1 - 32] = {
Font_PixelOperator_Regular_8_glyph_32,
Font_PixelOperator_Regular_8_glyph_33,
Font_PixelOperator_Regular_8_glyph_34,
Expand Down Expand Up @@ -305,3 +304,19 @@ const uint8_t * const Font_PixelOperator_Regular_8_upper[126 + 1 - 32] = {
Font_PixelOperator_Regular_8_glyph_125,
Font_PixelOperator_Regular_8_glyph_126,
};

const font_info_t Font_PixelOperator_Regular_8_info = {
.height = 8,
.max_height = 8,
.baseline = 1,
.glyph_data = Font_PixelOperator_Regular_8,
.glyph_nonprintable = Font_PixelOperator_Regular_8_glyph_nonprintable,
};

const font_info_t Font_PixelOperator_Regular_8_upper_info = {
.height = 8,
.max_height = 8,
.baseline = 1,
.glyph_data = Font_PixelOperator_Regular_8_upper,
.glyph_nonprintable = Font_PixelOperator_Regular_8_glyph_nonprintable,
};
12 changes: 4 additions & 8 deletions core/embed/lib/fonts/font_pixeloperator_regular_8.h
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
// This file is generated by core/tools/codegen/gen_font.py

#include <stdint.h>
#include "fonts_types.h"

#if TREZOR_FONT_BPP != 1
#error Wrong TREZOR_FONT_BPP (expected 1)
#endif
#define Font_PixelOperator_Regular_8_HEIGHT 8

#define Font_PixelOperator_Regular_8_MAX_HEIGHT 8
#define Font_PixelOperator_Regular_8_BASELINE 1
extern const uint8_t* const Font_PixelOperator_Regular_8[126 + 1 - 32];
extern const uint8_t Font_PixelOperator_Regular_8_glyph_nonprintable[];
#define Font_PixelOperator_Regular_8_upper_HEIGHT 8
extern const font_info_t Font_PixelOperator_Regular_8_info;
#define Font_PixelOperator_Regular_8_upper_MAX_HEIGHT 8
#define Font_PixelOperator_Regular_8_upper_BASELINE 1
extern const uint8_t* const Font_PixelOperator_Regular_8_upper[126 + 1 - 32];
extern const uint8_t Font_PixelOperator_Regular_8_upper_glyph_nonprintable[];
extern const font_info_t Font_PixelOperator_Regular_8_upper_info;
14 changes: 11 additions & 3 deletions core/embed/lib/fonts/font_pixeloperatormono_regular_8.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file is generated by core/tools/codegen/gen_font.py

#include <stdint.h>
#include "fonts_types.h"

// clang-format off

Expand All @@ -10,7 +11,6 @@

// NOTE: hand-changed all the advances with 8 to 7
// NOTE: hand-changed the visuals of "m", "w", "M" and "W" to make it narrower

/* */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_32[] = { 0, 0, 7, 0, 0 }; // width hand-changed from 8 to 7 to have 9px space between words
/* ! */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_33[] = { 1, 7, 7, 2, 7, 250 };
/* " */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_34[] = { 3, 3, 7, 1, 7, 182, 128 };
Expand Down Expand Up @@ -107,9 +107,9 @@
/* } */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_125[] = { 4, 7, 7, 0, 7, 194, 33, 34, 192 };
/* ~ */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_126[] = { 6, 2, 7, 0, 7, 102, 96 };

/* ? */ const uint8_t Font_PixelOperatorMono_Regular_8_glyph_nonprintable[] = { 5, 7, 7, 0, 7, 139, 189, 221, 255, 127 };
/* ? */ static const uint8_t Font_PixelOperatorMono_Regular_8_glyph_nonprintable[] = { 5, 7, 7, 0, 7, 139, 189, 221, 255, 127 };

const uint8_t * const Font_PixelOperatorMono_Regular_8[126 + 1 - 32] = {
static const uint8_t * const Font_PixelOperatorMono_Regular_8[126 + 1 - 32] = {
Font_PixelOperatorMono_Regular_8_glyph_32,
Font_PixelOperatorMono_Regular_8_glyph_33,
Font_PixelOperatorMono_Regular_8_glyph_34,
Expand Down Expand Up @@ -206,3 +206,11 @@ const uint8_t * const Font_PixelOperatorMono_Regular_8[126 + 1 - 32] = {
Font_PixelOperatorMono_Regular_8_glyph_125,
Font_PixelOperatorMono_Regular_8_glyph_126,
};

const font_info_t Font_PixelOperatorMono_Regular_8_info = {
.height = 8,
.max_height = 8,
.baseline = 1,
.glyph_data = Font_PixelOperatorMono_Regular_8,
.glyph_nonprintable = Font_PixelOperatorMono_Regular_8_glyph_nonprintable,
};
7 changes: 3 additions & 4 deletions core/embed/lib/fonts/font_pixeloperatormono_regular_8.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
// This file is generated by core/tools/codegen/gen_font.py

#include <stdint.h>
#include "fonts_types.h"

#if TREZOR_FONT_BPP != 1
#error Wrong TREZOR_FONT_BPP (expected 1)
#endif
#define Font_PixelOperatorMono_Regular_8_HEIGHT 8

#define Font_PixelOperatorMono_Regular_8_MAX_HEIGHT 8
#define Font_PixelOperatorMono_Regular_8_BASELINE 1
extern const uint8_t* const Font_PixelOperatorMono_Regular_8[126 + 1 - 32];
extern const uint8_t Font_PixelOperatorMono_Regular_8_glyph_nonprintable[];
extern const font_info_t Font_PixelOperatorMono_Regular_8_info;
13 changes: 11 additions & 2 deletions core/embed/lib/fonts/font_roboto_bold_20.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file is generated by core/tools/codegen/gen_font.py

#include <stdint.h>
#include "fonts_types.h"

// clang-format off

Expand Down Expand Up @@ -104,9 +105,9 @@
/* } */ static const uint8_t Font_Roboto_Bold_20_glyph_125[] = { 7, 20, 7, 0, 16, 180, 3, 0, 0, 248, 79, 0, 0, 176, 239, 0, 0, 64, 255, 3, 0, 32, 255, 5, 0, 32, 255, 6, 0, 32, 255, 6, 0, 16, 255, 7, 0, 0, 252, 45, 0, 0, 210, 255, 2, 0, 210, 255, 2, 0, 252, 45, 0, 16, 255, 7, 0, 32, 255, 6, 0, 32, 255, 6, 0, 32, 255, 5, 0, 64, 255, 3, 0, 176, 239, 0, 0, 248, 79, 0, 0, 180, 3, 0, 0 };
/* ~ */ static const uint8_t Font_Roboto_Bold_20_glyph_126[] = { 11, 5, 13, 1, 8, 96, 254, 60, 0, 162, 9, 245, 255, 255, 6, 249, 12, 252, 108, 252, 255, 255, 6, 237, 3, 128, 255, 175, 0, 0, 0, 0, 65, 2, 0 };

/* ? */ const uint8_t Font_Roboto_Bold_20_glyph_nonprintable[] = { 10, 14, 10, 0, 14, 255, 40, 16, 163, 255, 79, 0, 0, 0, 247, 11, 16, 137, 0, 240, 8, 160, 255, 5, 192, 255, 255, 255, 4, 208, 255, 255, 175, 0, 243, 255, 255, 10, 16, 253, 255, 239, 0, 209, 255, 255, 143, 0, 251, 255, 255, 111, 16, 255, 255, 255, 255, 255, 255, 255, 255, 159, 65, 255, 255, 255, 47, 0, 252, 255, 255, 143, 64, 255, 255 };
/* ? */ static const uint8_t Font_Roboto_Bold_20_glyph_nonprintable[] = { 10, 14, 10, 0, 14, 255, 40, 16, 163, 255, 79, 0, 0, 0, 247, 11, 16, 137, 0, 240, 8, 160, 255, 5, 192, 255, 255, 255, 4, 208, 255, 255, 175, 0, 243, 255, 255, 10, 16, 253, 255, 239, 0, 209, 255, 255, 143, 0, 251, 255, 255, 111, 16, 255, 255, 255, 255, 255, 255, 255, 255, 159, 65, 255, 255, 255, 47, 0, 252, 255, 255, 143, 64, 255, 255 };

const uint8_t * const Font_Roboto_Bold_20[126 + 1 - 32] = {
static const uint8_t * const Font_Roboto_Bold_20[126 + 1 - 32] = {
Font_Roboto_Bold_20_glyph_32,
Font_Roboto_Bold_20_glyph_33,
Font_Roboto_Bold_20_glyph_34,
Expand Down Expand Up @@ -203,3 +204,11 @@ const uint8_t * const Font_Roboto_Bold_20[126 + 1 - 32] = {
Font_Roboto_Bold_20_glyph_125,
Font_Roboto_Bold_20_glyph_126,
};

const font_info_t Font_Roboto_Bold_20_info = {
.height = 20,
.max_height = 21,
.baseline = 4,
.glyph_data = Font_Roboto_Bold_20,
.glyph_nonprintable = Font_Roboto_Bold_20_glyph_nonprintable,
};
7 changes: 3 additions & 4 deletions core/embed/lib/fonts/font_roboto_bold_20.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
// This file is generated by core/tools/codegen/gen_font.py

#include <stdint.h>
#include "fonts_types.h"

#if TREZOR_FONT_BPP != 4
#error Wrong TREZOR_FONT_BPP (expected 4)
#endif
#define Font_Roboto_Bold_20_HEIGHT 20

#define Font_Roboto_Bold_20_MAX_HEIGHT 21
#define Font_Roboto_Bold_20_BASELINE 4
extern const uint8_t* const Font_Roboto_Bold_20[126 + 1 - 32];
extern const uint8_t Font_Roboto_Bold_20_glyph_nonprintable[];
extern const font_info_t Font_Roboto_Bold_20_info;
13 changes: 11 additions & 2 deletions core/embed/lib/fonts/font_roboto_regular_20.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This file is generated by core/tools/codegen/gen_font.py

#include <stdint.h>
#include "fonts_types.h"

// clang-format off

Expand Down Expand Up @@ -104,9 +105,9 @@
/* } */ static const uint8_t Font_Roboto_Regular_20_glyph_125[] = { 7, 20, 7, 0, 16, 152, 1, 0, 0, 228, 29, 0, 0, 48, 159, 0, 0, 0, 238, 0, 0, 0, 252, 0, 0, 0, 252, 0, 0, 0, 252, 0, 0, 0, 250, 2, 0, 0, 244, 27, 0, 0, 112, 255, 1, 0, 209, 143, 0, 0, 248, 5, 0, 0, 251, 1, 0, 0, 252, 0, 0, 0, 252, 0, 0, 0, 252, 0, 0, 0, 222, 0, 0, 80, 143, 0, 0, 229, 29, 0, 0, 152, 1, 0, 0 };
/* ~ */ static const uint8_t Font_Roboto_Regular_20_glyph_126[] = { 12, 4, 14, 1, 8, 64, 253, 109, 0, 32, 59, 243, 173, 254, 43, 161, 31, 249, 1, 144, 255, 255, 7, 50, 0, 0, 115, 56, 0 };

/* ? */ const uint8_t Font_Roboto_Regular_20_glyph_nonprintable[] = { 9, 14, 9, 0, 14, 255, 57, 16, 213, 255, 111, 16, 69, 16, 254, 14, 242, 255, 8, 247, 125, 250, 255, 12, 245, 255, 255, 255, 10, 248, 255, 255, 239, 1, 254, 255, 255, 46, 160, 255, 255, 255, 3, 250, 255, 255, 191, 96, 255, 255, 255, 143, 160, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 159, 160, 255, 255, 255, 159, 160, 255, 255 };
/* ? */ static const uint8_t Font_Roboto_Regular_20_glyph_nonprintable[] = { 9, 14, 9, 0, 14, 255, 57, 16, 213, 255, 111, 16, 69, 16, 254, 14, 242, 255, 8, 247, 125, 250, 255, 12, 245, 255, 255, 255, 10, 248, 255, 255, 239, 1, 254, 255, 255, 46, 160, 255, 255, 255, 3, 250, 255, 255, 191, 96, 255, 255, 255, 143, 160, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 159, 160, 255, 255, 255, 159, 160, 255, 255 };

const uint8_t * const Font_Roboto_Regular_20[126 + 1 - 32] = {
static const uint8_t * const Font_Roboto_Regular_20[126 + 1 - 32] = {
Font_Roboto_Regular_20_glyph_32,
Font_Roboto_Regular_20_glyph_33,
Font_Roboto_Regular_20_glyph_34,
Expand Down Expand Up @@ -203,3 +204,11 @@ const uint8_t * const Font_Roboto_Regular_20[126 + 1 - 32] = {
Font_Roboto_Regular_20_glyph_125,
Font_Roboto_Regular_20_glyph_126,
};

const font_info_t Font_Roboto_Regular_20_info = {
.height = 20,
.max_height = 22,
.baseline = 5,
.glyph_data = Font_Roboto_Regular_20,
.glyph_nonprintable = Font_Roboto_Regular_20_glyph_nonprintable,
};
7 changes: 3 additions & 4 deletions core/embed/lib/fonts/font_roboto_regular_20.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
// This file is generated by core/tools/codegen/gen_font.py

#include <stdint.h>
#include "fonts_types.h"

#if TREZOR_FONT_BPP != 4
#error Wrong TREZOR_FONT_BPP (expected 4)
#endif
#define Font_Roboto_Regular_20_HEIGHT 20

#define Font_Roboto_Regular_20_MAX_HEIGHT 22
#define Font_Roboto_Regular_20_BASELINE 5
extern const uint8_t* const Font_Roboto_Regular_20[126 + 1 - 32];
extern const uint8_t Font_Roboto_Regular_20_glyph_nonprintable[];
extern const font_info_t Font_Roboto_Regular_20_info;
Loading
Loading