mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-05-23 17:28:46 +00:00
feat(core/rust/ui): expose text_max_height and baseline
[no changelog]
This commit is contained in:
parent
615c8a0e64
commit
3f6ea00e02
@ -1022,15 +1022,23 @@ impl From<Font> for i32 {
|
|||||||
|
|
||||||
impl Font {
|
impl Font {
|
||||||
pub fn text_width(self, text: &str) -> i16 {
|
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 {
|
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 {
|
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 {
|
pub fn line_height(self) -> i16 {
|
||||||
|
Loading…
Reference in New Issue
Block a user