-
-
Notifications
You must be signed in to change notification settings - Fork 672
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP - loading font data from translations blob
- Loading branch information
Showing
14 changed files
with
699 additions
and
266 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,28 @@ | ||
use super::ffi; | ||
|
||
#[repr(C)] | ||
pub struct PointerData { | ||
pub ptr: *const u8, | ||
pub len: u32, | ||
} | ||
|
||
pub fn translations_get() -> &'static [u8] { | ||
let mut len: u32 = 0; | ||
let ptr = unsafe { ffi::translations_read(&mut len) }; | ||
let ptr = unsafe { ffi::translations_read(&mut len, 0) }; | ||
if ptr.is_null() { | ||
fatal_error!("Translations read failed", ""); | ||
} | ||
unsafe { core::slice::from_raw_parts(ptr, len as usize) } | ||
} | ||
|
||
pub fn get_font_pointer(area_offset: u16, len: u16) -> PointerData { | ||
let mut overall_len: u32 = 0; | ||
let ptr = unsafe { ffi::translations_read(&mut overall_len, area_offset.into()) }; | ||
if ptr.is_null() { | ||
fatal_error!("Translations read failed", ""); | ||
} | ||
PointerData { | ||
ptr, | ||
len: len.into(), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
{ | ||
"font": { | ||
"file": "font_pixeloperator_regular_8_cs.json" | ||
}, | ||
"header": { | ||
"language": "cs", | ||
"version": "2.6.3" | ||
|
152 changes: 152 additions & 0 deletions
152
core/embed/rust/src/ui/translations/font_pixeloperator_regular_8_cs.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
[ | ||
{ | ||
"char": "Á", | ||
"utf8": "C381", | ||
"data": "0507060007111d18fe20" | ||
}, | ||
{ | ||
"char": "Č", | ||
"utf8": "C48C", | ||
"data": "0507060007511d1845c0" | ||
}, | ||
{ | ||
"char": "Ď", | ||
"utf8": "C48E", | ||
"data": "0507060007513d18c7c0" | ||
}, | ||
{ | ||
"char": "É", | ||
"utf8": "C389", | ||
"data": "0507060007113f0e43e0" | ||
}, | ||
{ | ||
"char": "Ě", | ||
"utf8": "C49A", | ||
"data": "0507060007513f0e43e0" | ||
}, | ||
{ | ||
"char": "Í", | ||
"utf8": "C38D", | ||
"data": "020704010762a8" | ||
}, | ||
{ | ||
"char": "Ň", | ||
"utf8": "C587", | ||
"data": "050706000751239ace20" | ||
}, | ||
{ | ||
"char": "Ó", | ||
"utf8": "C393", | ||
"data": "0507060007111d18c5c0" | ||
}, | ||
{ | ||
"char": "Ř", | ||
"utf8": "C598", | ||
"data": "0507060007513d18fa20" | ||
}, | ||
{ | ||
"char": "Š", | ||
"utf8": "C5A0", | ||
"data": "0507060007511d0707c0" | ||
}, | ||
{ | ||
"char": "Ť", | ||
"utf8": "C5A4", | ||
"data": "0507060007513e421080" | ||
}, | ||
{ | ||
"char": "Ú", | ||
"utf8": "C39A", | ||
"data": "0507060007112318c5c0" | ||
}, | ||
{ | ||
"char": "Ů", | ||
"utf8": "C5AE", | ||
"data": "0507060007228918c5c0" | ||
}, | ||
{ | ||
"char": "Ý", | ||
"utf8": "C39D", | ||
"data": "05070600071123151080" | ||
}, | ||
{ | ||
"char": "Ž", | ||
"utf8": "C5BD", | ||
"data": "0507060007513e2223e0" | ||
}, | ||
{ | ||
"char": "á", | ||
"utf8": "C3A1", | ||
"data": "0507060007111c17c5e0" | ||
}, | ||
{ | ||
"char": "č", | ||
"utf8": "C48D", | ||
"data": "0507060007511d1845c0" | ||
}, | ||
{ | ||
"char": "ď", | ||
"utf8": "C48F", | ||
"data": "09070b000708845e51088441e0" | ||
}, | ||
{ | ||
"char": "é", | ||
"utf8": "C3A9", | ||
"data": "0507060007111d1fc1c0" | ||
}, | ||
{ | ||
"char": "ě", | ||
"utf8": "C49B", | ||
"data": "0507060007511d1fc1c0" | ||
}, | ||
{ | ||
"char": "í", | ||
"utf8": "C3AD", | ||
"data": "020704010762a8" | ||
}, | ||
{ | ||
"char": "ň", | ||
"utf8": "C588", | ||
"data": "0507060007513d18c620" | ||
}, | ||
{ | ||
"char": "ó", | ||
"utf8": "C3B3", | ||
"data": "0507060007111d18c5c0" | ||
}, | ||
{ | ||
"char": "ř", | ||
"utf8": "C599", | ||
"data": "050706000751274c4200" | ||
}, | ||
{ | ||
"char": "š", | ||
"utf8": "C5A1", | ||
"data": "0507060007511d0707c0" | ||
}, | ||
{ | ||
"char": "ť", | ||
"utf8": "C5A5", | ||
"data": "08070a00070141f24040403000" | ||
}, | ||
{ | ||
"char": "ú", | ||
"utf8": "C3BA", | ||
"data": "0507060007112318c5c0" | ||
}, | ||
{ | ||
"char": "ů", | ||
"utf8": "C5AF", | ||
"data": "0507060007228918c5c0" | ||
}, | ||
{ | ||
"char": "ý", | ||
"utf8": "C3BD", | ||
"data": "0508060007112318bc2e00" | ||
}, | ||
{ | ||
"char": "ž", | ||
"utf8": "C5BE", | ||
"data": "0507060007513e2223e0" | ||
} | ||
] |
Oops, something went wrong.