From 3f6ea00e021deb556dc6e1134fc08d1c97f453fd Mon Sep 17 00:00:00 2001 From: matejcik Date: Wed, 23 Nov 2022 15:19:52 +0100 Subject: [PATCH] feat(core/rust/ui): expose text_max_height and baseline [no changelog] --- core/embed/rust/src/ui/display/mod.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/core/embed/rust/src/ui/display/mod.rs b/core/embed/rust/src/ui/display/mod.rs index ad4f8ab6fd..2c8372bd4b 100644 --- a/core/embed/rust/src/ui/display/mod.rs +++ b/core/embed/rust/src/ui/display/mod.rs @@ -1022,15 +1022,23 @@ impl From for i32 { impl Font { pub fn text_width(self, text: &str) -> i16 { - display::text_width(text, self.into()) as i16 + display::text_width(text, self.into()) } pub fn char_width(self, ch: char) -> i16 { - display::char_width(ch, self.into()) as i16 + display::char_width(ch, self.into()) } pub fn text_height(self) -> i16 { - display::text_height(self.into()) as i16 + display::text_height(self.into()) + } + + pub fn text_max_height(self) -> i16 { + display::text_max_height(self.into()) + } + + pub fn text_baseline(self) -> i16 { + display::text_baseline(self.into()) } pub fn line_height(self) -> i16 {