From dd36660f473954787c3d6929f4d122f3f2acfb9c Mon Sep 17 00:00:00 2001 From: obrusvit Date: Mon, 9 Dec 2024 11:57:45 +0100 Subject: [PATCH] fixup! refactor(core): remove UTF-8 support from C --- core/embed/rust/src/trezorhal/display.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/embed/rust/src/trezorhal/display.rs b/core/embed/rust/src/trezorhal/display.rs index 99d430fe4f..4152fbd027 100644 --- a/core/embed/rust/src/trezorhal/display.rs +++ b/core/embed/rust/src/trezorhal/display.rs @@ -12,6 +12,11 @@ pub fn backlight(val: i32) -> i32 { } pub fn get_font_info(font: i32) -> Option { + // SAFETY: + // - `ffi::get_font_info` returns either null (for invalid fonts) or a pointer to a static font_info_t struct + // - The font_info_t data is in ROM, making it immutable and static + // - The font_info_t contains pointers to static glyph data arrays also in ROM + // - All font data is generated at compile time and included in the binary unsafe { let font = ffi::get_font_info(font); Some(*font.as_ref()?)