From 45d747fa91f2d5e8095a70708a124de6ca69186b Mon Sep 17 00:00:00 2001 From: obrusvit Date: Mon, 9 Dec 2024 11:57:34 +0100 Subject: [PATCH] fixup! refactor(core): remove UTF-8 support from C --- core/embed/rust/src/ui/display/font.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/core/embed/rust/src/ui/display/font.rs b/core/embed/rust/src/ui/display/font.rs index b901ddde23..5c14f2b6c5 100644 --- a/core/embed/rust/src/ui/display/font.rs +++ b/core/embed/rust/src/ui/display/font.rs @@ -249,19 +249,23 @@ impl Font { (start + end + self.visible_text_height(text)) / 2 } - fn get_glyph_data(&self, c: u16) -> *const u8 { + fn get_glyph_data(&self, codepoint: u16) -> *const u8 { display::get_font_info((*self).into()).map_or(core::ptr::null(), |font_info| { #[cfg(feature = "translations")] { - if c >= 0x7F { + if codepoint >= 0x7F { // UTF8 character from embedded blob - return unsafe { get_utf8_glyph(c, *self) }; + return unsafe { get_utf8_glyph(codepoint, *self) }; } } - if c >= ' ' as u16 && c < 0x7F { + if codepoint >= ' ' as u16 && codepoint < 0x7F { // ASCII character - unsafe { *font_info.glyph_data.offset((c - ' ' as u16) as isize) } + unsafe { + *font_info + .glyph_data + .offset((codepoint - ' ' as u16) as isize) + } } else { font_info.glyph_nonprintable }