pub struct FontReader { /* private fields */ }Expand description
Helper struct for reading TTF data with proper endianness handling
Implementations§
Source§impl FontReader
impl FontReader
pub fn new(data: Vec<u8>) -> Self
pub fn from_slice(slice: &[u8]) -> Self
pub fn position(&self) -> usize
pub fn set_position(&mut self, pos: usize) -> Result<(), Error>
pub fn skip(&mut self, bytes: usize) -> Result<(), Error>
pub fn remaining(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn into_inner(self) -> Vec<u8> ⓘ
pub fn read_u8(&mut self) -> Result<u8, Error>
pub fn read_i8(&mut self) -> Result<i8, Error>
pub fn read_u16(&mut self) -> Result<u16, Error>
pub fn read_i16(&mut self) -> Result<i16, Error>
pub fn read_u24(&mut self) -> Result<u32, Error>
pub fn read_u32(&mut self) -> Result<u32, Error>
pub fn read_i32(&mut self) -> Result<i32, Error>
pub fn read_u64(&mut self) -> Result<u64, Error>
pub fn read_i64(&mut self) -> Result<i64, Error>
pub fn read_fixed(&mut self) -> Result<f32, Error>
pub fn read_f2dot14(&mut self) -> Result<f32, Error>
pub fn read_long_datetime(&mut self) -> Result<u64, Error>
pub fn read_tag(&mut self) -> Result<[u8; 4], Error>
pub fn read_bytes(&mut self, len: usize) -> Result<Vec<u8>, Error>
pub fn read_string(&mut self, len: usize) -> Result<String, Error>
Auto Trait Implementations§
impl Freeze for FontReader
impl RefUnwindSafe for FontReader
impl Send for FontReader
impl Sync for FontReader
impl Unpin for FontReader
impl UnwindSafe for FontReader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more