struct Parser<'a> {
data: &'a [u8],
pos: usize,
}Fields§
§data: &'a [u8]§pos: usizeImplementations§
Source§impl<'a> Parser<'a>
impl<'a> Parser<'a>
fn new(data: &'a [u8]) -> Self
fn next(&mut self) -> Option<Token<'a>>
fn peek(&self) -> Option<Token<'a>>
fn accept(&mut self, token: Token<'_>) -> bool
fn expect(&mut self, token: Token<'_>) -> Option<()>
fn next_byte(&mut self) -> Option<u8>
fn peek_byte(&self) -> Option<u8>
fn read_bytes(&mut self, len: usize) -> Option<&'a [u8]>
fn skip_whitespace(&mut self) -> Option<()>
fn skip_line(&mut self)
fn skip_until(&mut self, f: impl Fn(u8) -> bool) -> usize
fn read_proc(&mut self, start: usize) -> Option<Token<'a>>
fn read_lit_string(&mut self, start: usize) -> Option<Token<'a>>
fn read_hex_string(&mut self, start: usize) -> Option<Token<'a>>
fn read_int(&mut self) -> Option<i64>
fn read_num_as_int(&mut self) -> Option<i32>
fn read_string(&mut self) -> Option<String>
Source§impl Parser<'_>
impl Parser<'_>
Sourcefn read_font_matrix(&mut self) -> Option<ScaledFontMatrix>
fn read_font_matrix(&mut self) -> Option<ScaledFontMatrix>
Parse a font matrix.
Like FreeType, this is designed assuming a upem of 1000 and produces an identity matrix in that case. This is, the result is scaled such that 0.001 yields a value of 1.0.
Sourcefn read_subrs(&mut self, len_iv: i64) -> Option<Subrs>
fn read_subrs(&mut self, len_iv: i64) -> Option<Subrs>
Parse the set of subroutines.
The len_iv parameter defines the number of prefix padding bytes for
encrypted data. If < 0, then the data is not encrypted.
Sourcefn read_charstrings(&mut self, len_iv: i64) -> Option<Charstrings>
fn read_charstrings(&mut self, len_iv: i64) -> Option<Charstrings>
Parse the set of charstrings.
The len_iv parameter defines the number of prefix padding bytes for
encrypted data. If < 0, then the data is not encrypted.
fn read_font_bbox(&mut self) -> Option<[Fixed; 4]>
fn read_weight_vector(&mut self) -> Option<Vec<Fixed>>
Sourcefn read_encoding(&mut self, charstrings: &Charstrings) -> Option<RawEncoding>
fn read_encoding(&mut self, charstrings: &Charstrings) -> Option<RawEncoding>
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Parser<'a>
impl<'a> RefUnwindSafe for Parser<'a>
impl<'a> Send for Parser<'a>
impl<'a> Sync for Parser<'a>
impl<'a> Unpin for Parser<'a>
impl<'a> UnsafeUnpin for Parser<'a>
impl<'a> UnwindSafe for Parser<'a>
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