diff --git a/common/protob/messages-management.proto b/common/protob/messages-management.proto index 1a14d7036..539ad4fc1 100644 --- a/common/protob/messages-management.proto +++ b/common/protob/messages-management.proto @@ -181,7 +181,7 @@ message ApplySettings { } /** - * Request: change the device language via translation data + * Request: change the device language via translation data. * Does not send the translation data itself, as they are too large for one message. * Device will request the translation data in chunks. * @start @@ -189,7 +189,7 @@ message ApplySettings { * @next Failure */ message ChangeLanguage { - required uint32 data_length = 1; // byte length of the whole translation blob (set to 0 for default language) + required uint32 data_length = 1; // byte length of the whole translation blob (set to 0 for default language - english) } /** @@ -198,7 +198,7 @@ message ChangeLanguage { * @next TranslationDataAck */ message TranslationDataRequest { - required uint32 data_length = 1; // Number of bytes being requested (<= 1024) + required uint32 data_length = 1; // Number of bytes being requested required uint32 data_offset = 2; // Offset of the first byte being requested } @@ -208,7 +208,7 @@ message ChangeLanguage { * @next Success */ message TranslationDataAck { - required bytes data_chunk = 1; // Bytes from translation payload (<= 1024 bytes) + required bytes data_chunk = 1; // Bytes from translation payload } /** diff --git a/core/embed/extmod/modtrezorconfig/modtrezorconfig.c b/core/embed/extmod/modtrezorconfig/modtrezorconfig.c index 02bcbe8d5..4678cd0fc 100644 --- a/core/embed/extmod/modtrezorconfig/modtrezorconfig.c +++ b/core/embed/extmod/modtrezorconfig/modtrezorconfig.c @@ -17,7 +17,6 @@ * along with this program. If not, see . */ -#include #include #include "py/mphal.h" @@ -340,7 +339,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(mod_trezorconfig_translations_set_obj, /// def translations_wipe() -> None: /// """ -/// Wipe all the translations data before writing a new one +/// Wipe all the translations data before writing a new one. /// """ STATIC mp_obj_t mod_trezorconfig_translations_wipe(void) { translations_erase(); @@ -351,7 +350,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_0(mod_trezorconfig_translations_wipe_obj, /// def translations_max_bytesize() -> int: /// """ -/// How much is the maximum bytesize of translations data +/// How much is the maximum bytesize of translations data. /// """ STATIC mp_obj_t mod_trezorconfig_translations_max_bytesize(void) { uint32_t count = translations_area_bytesize(); diff --git a/core/embed/lib/fonts/font_unifont_regular_16.c b/core/embed/lib/fonts/font_unifont_regular_16.c index bb0607f1b..8ef83037c 100644 --- a/core/embed/lib/fonts/font_unifont_regular_16.c +++ b/core/embed/lib/fonts/font_unifont_regular_16.c @@ -104,7 +104,7 @@ /* { */ static const uint8_t Font_Unifont_Regular_16_glyph_123[] = { 4, 13, 7, 1, 11, 52, 66, 36, 132, 34, 68, 48 }; /* | */ static const uint8_t Font_Unifont_Regular_16_glyph_124[] = { 1, 14, 7, 3, 12, 255, 252 }; /* } */ static const uint8_t Font_Unifont_Regular_16_glyph_125[] = { 4, 13, 7, 1, 11, 194, 36, 66, 18, 68, 34, 192 }; -/* ~ */ static const uint8_t Font_Unifont_Regular_16_glyph_126[] = { 7, 3, 7, 0, 11, 99, 38, 48 }; +/* ~ */ static const uint8_t Font_Unifont_Regular_16_glyph_126[] = { 7, 3, 8, 0, 11, 99, 38, 48 }; // < --- advanced changed from 7 to 8 /* ? */ const uint8_t Font_Unifont_Regular_16_glyph_nonprintable[] = { 6, 10, 7, 0, 10, 133, 231, 190, 247, 190, 255, 239, 191 }; diff --git a/core/embed/lib/fonts/fonts.c b/core/embed/lib/fonts/fonts.c index eaf4db350..936139fdf 100644 --- a/core/embed/lib/fonts/fonts.c +++ b/core/embed/lib/fonts/fonts.c @@ -19,7 +19,7 @@ #include "fonts.h" #include -#include +#include #ifdef TRANSLATIONS #include "librust_fonts.h" #endif @@ -139,8 +139,8 @@ int font_baseline(int font) { const uint8_t *font_get_glyph(int font, uint8_t c) { uint16_t c_2bytes = convert_char_utf8(c); - bool is_printable = c_2bytes != 0x7F; if (!c_2bytes) return 0; + bool is_printable = c_2bytes != 0x7F; #ifdef TRANSLATIONS // found UTF8 character @@ -148,6 +148,8 @@ const uint8_t *font_get_glyph(int font, uint8_t c) { // embedded blob if (c_2bytes > 0xFF) { PointerData glyph_data = get_utf8_glyph(c_2bytes, font); + // TODO: is it better to use (!glyph_data.ptr) or (glyph_data.ptr == NULL)? + // first one does not require import if (glyph_data.ptr != NULL) { return glyph_data.ptr; } else { diff --git a/core/embed/models/model_T2T1_layout.c b/core/embed/models/model_T2T1_layout.c index 65932add5..7d26440cc 100644 --- a/core/embed/models/model_T2T1_layout.c +++ b/core/embed/models/model_T2T1_layout.c @@ -33,7 +33,6 @@ const flash_area_t TRANSLATIONS_AREA = { .num_subareas = 1, .subarea[0] = { - // TODO: can we use the 4th sector? .first_sector = 12, .num_sectors = 3, }, diff --git a/core/embed/rust/librust_fonts.h b/core/embed/rust/librust_fonts.h index d21cc14b5..a04a0bf54 100644 --- a/core/embed/rust/librust_fonts.h +++ b/core/embed/rust/librust_fonts.h @@ -3,4 +3,5 @@ typedef struct { uint32_t len; } PointerData; +// TODO: Theoretically, the `len` is not used by the client and does not have to be sent PointerData get_utf8_glyph(uint16_t char_code, int font); diff --git a/core/embed/trezorhal/translations.h b/core/embed/trezorhal/translations.h index bf82d1859..fad837615 100644 --- a/core/embed/trezorhal/translations.h +++ b/core/embed/trezorhal/translations.h @@ -1,6 +1,4 @@ - #include -#include "secbool.h" void translations_write(uint8_t* data, uint32_t offset, uint32_t len); diff --git a/core/mocks/generated/trezorconfig.pyi b/core/mocks/generated/trezorconfig.pyi index 9f554abbe..d8f677716 100644 --- a/core/mocks/generated/trezorconfig.pyi +++ b/core/mocks/generated/trezorconfig.pyi @@ -118,14 +118,14 @@ def translations_set(blob: bytes, offset: int) -> None: # extmod/modtrezorconfig/modtrezorconfig.c def translations_wipe() -> None: """ - Wipe all the translations data before writing a new one + Wipe all the translations data before writing a new one. """ # extmod/modtrezorconfig/modtrezorconfig.c def translations_max_bytesize() -> int: """ - How much is the maximum bytesize of translations data + How much is the maximum bytesize of translations data. """