-
-
Notifications
You must be signed in to change notification settings - Fork 652
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
base: main
Are you sure you want to change the base?
Conversation
Introduce a new flag `_NAME` for each font and reduce the usage of `_ENABLE` flag to purely compilation guard. [no changelog]
[no changelog]
|
i think we will drop entire buffers.c/h when we get rid of old rendering, which will hopefully be soon enough. |
00e4847
to
1fce051
Compare
Can the change of order in translation jsons cause some problems moving forward @matejcik ? If so, I can revert it and just define the The reason to start from |
yeah the ids are baked into the translation blobs, this would really mess up the upgrade/downgrade scenario. please revert. aside, I believe that there was a reason for skipping 0 for font index, but perhaps it doesn't apply anymore with this refactor? |
This commit removes the usage of macros for font data definitions. Instead, it includes data as const structs of newly introduced font_info_t type. [no changelog]
Change to the new structures and preserve manual changes. This commit also removes duplicated definition of nonprintable glyph for _UPPER fonts. [no changelog]
[no changelog]
1fce051
to
94db1ee
Compare
I reverted the re-assignment of font IDs. The PR is ready for review. For future reference: after we drop |
This PR aims to further simplify the font handling in
core
.The main objective was to get rid of the numerous macros, which are quite cumbersome to work with. This is achieved by introducing
struct font_info_t
which is filled with needed data for each font during font generation bygen_font.py
. Then there is a functionget_font_info
defined In thecore/embed/lib/fonts/fonts.c
which is used to access font data.Unfortunately, I was unable to get rid of the
FONT_MAX_HEIGHT
calculation as it must be done in compile time. However, there is only one usage so getting rid of it is perhaps feasible.trezor-firmware/core/embed/lib/buffers.h
Line 32 in 02533aa
TODO:
_UPPER
fonts seems not effective