mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-14 02:18:07 +00:00
fixup! fixup! refactor(core): safe iface for get_glyph_data
This commit is contained in:
parent
74a84516f9
commit
fb7cf535a3
@ -259,7 +259,8 @@ impl<'a> Translations<'a> {
|
|||||||
&self.header
|
&self.header
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns a byte slice of the glyph data for the given UTF-8 codepoint in the specified font.
|
/// Returns a byte slice of the glyph data for the given UTF-8 codepoint in
|
||||||
|
/// the specified font.
|
||||||
///
|
///
|
||||||
/// SAFETY: Do not mess with the lifetimes in this signature.
|
/// SAFETY: Do not mess with the lifetimes in this signature.
|
||||||
///
|
///
|
||||||
|
@ -180,7 +180,8 @@ impl GlyphData {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns glyph data slice from a raw pointer by reading the header and calculating full size.
|
/// Returns glyph data slice from a raw pointer by reading the header and
|
||||||
|
/// calculating full size.
|
||||||
unsafe fn load_glyph_from_ptr(&self, ptr: *const u8) -> &[u8] {
|
unsafe fn load_glyph_from_ptr(&self, ptr: *const u8) -> &[u8] {
|
||||||
unsafe {
|
unsafe {
|
||||||
let header = slice::from_raw_parts(ptr, 2);
|
let header = slice::from_raw_parts(ptr, 2);
|
||||||
|
Loading…
Reference in New Issue
Block a user