mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-13 09:58:09 +00:00
fixup! refactor(core): remove UTF-8 support from C
This commit is contained in:
parent
9f98797188
commit
560dd51c71
@ -1,5 +1,4 @@
|
|||||||
use crate::{
|
use crate::{
|
||||||
translations::get_utf8_glyph,
|
|
||||||
trezorhal::display,
|
trezorhal::display,
|
||||||
ui::{
|
ui::{
|
||||||
constant,
|
constant,
|
||||||
@ -9,6 +8,9 @@ use crate::{
|
|||||||
};
|
};
|
||||||
use core::slice;
|
use core::slice;
|
||||||
|
|
||||||
|
#[cfg(feature = "translations")]
|
||||||
|
use crate::translations::get_utf8_glyph;
|
||||||
|
|
||||||
/// Representation of a single glyph.
|
/// Representation of a single glyph.
|
||||||
/// We use standard typographic terms. For a nice explanation, see, e.g.,
|
/// We use standard typographic terms. For a nice explanation, see, e.g.,
|
||||||
/// the FreeType docs at https://www.freetype.org/freetype2/docs/glyphs/glyphs-3.html
|
/// the FreeType docs at https://www.freetype.org/freetype2/docs/glyphs/glyphs-3.html
|
||||||
@ -249,10 +251,15 @@ impl Font {
|
|||||||
|
|
||||||
fn get_glyph_data(&self, c: u16) -> *const u8 {
|
fn get_glyph_data(&self, c: u16) -> *const u8 {
|
||||||
display::get_font_info((*self).into()).map_or(core::ptr::null(), |font_info| {
|
display::get_font_info((*self).into()).map_or(core::ptr::null(), |font_info| {
|
||||||
if c >= 0x7F {
|
#[cfg(feature = "translations")]
|
||||||
// UTF8 character from embedded blob
|
{
|
||||||
unsafe { get_utf8_glyph(c, *self) }
|
if c >= 0x7F {
|
||||||
} else if c >= ' ' as u16 && c < 0x7F {
|
// UTF8 character from embedded blob
|
||||||
|
return unsafe { get_utf8_glyph(c, *self) };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if c >= ' ' as u16 && c < 0x7F {
|
||||||
// ASCII character
|
// ASCII character
|
||||||
unsafe { *font_info.glyph_data.offset((c - ' ' as u16) as isize) }
|
unsafe { *font_info.glyph_data.offset((c - ' ' as u16) as isize) }
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user