Skip to main content

ParseAccumulator

Struct ParseAccumulator 

Source
pub(crate) struct ParseAccumulator<'a> {
Show 22 fields pub(crate) header: HeaderState, pub(crate) state: State, pub(crate) composites_depth: u32, pub(crate) direction: DirectionState, pub(crate) finish: FinishState, pub(crate) font_name: Cow<'a, str>, pub(crate) full_name: Cow<'a, str>, pub(crate) family_name: Cow<'a, str>, pub(crate) weight: Cow<'a, str>, pub(crate) encoding_scheme: Cow<'a, str>, pub(crate) italic_angle: f32, pub(crate) is_fixed_pitch: bool, pub(crate) font_bbox: BBox, pub(crate) font_bbox_presence: Presence, pub(crate) underline_position: f32, pub(crate) underline_thickness: f32, pub(crate) cap_height: f32, pub(crate) x_height: f32, pub(crate) ascender: f32, pub(crate) descender: f32, pub(crate) chars: Vec<CharacterMetric<'a>>, pub(crate) kerns: Vec<KerningPair<'a>>,
}

Fields§

§header: HeaderState§state: State§composites_depth: u32§direction: DirectionState§finish: FinishState§font_name: Cow<'a, str>§full_name: Cow<'a, str>§family_name: Cow<'a, str>§weight: Cow<'a, str>§encoding_scheme: Cow<'a, str>§italic_angle: f32§is_fixed_pitch: bool§font_bbox: BBox§font_bbox_presence: Presence§underline_position: f32§underline_thickness: f32§cap_height: f32§x_height: f32§ascender: f32§descender: f32§chars: Vec<CharacterMetric<'a>>§kerns: Vec<KerningPair<'a>>

Implementations§

Source§

impl<'a> ParseAccumulator<'a>

Source

pub(crate) fn new() -> Self

Source

pub(crate) fn parse_line( &mut self, raw: &'a str, lineno: usize, ) -> Result<(), ParseError>

Source

pub(crate) fn finish(self) -> Result<FontMetrics<'a>, ParseError>

Source

pub(crate) fn skip_block_line(&mut self, kw: &str) -> bool

Source

pub(crate) fn parse_header_line( &mut self, kw: &str, rest: &str, lineno: usize, ) -> Result<bool, ParseError>

Source

pub(crate) fn is_done(&self) -> bool

Source

pub(crate) fn parse_body_line( &mut self, line: &'a str, kw: &str, rest: &'a str, lineno: usize, ) -> Result<(), ParseError>

Source

pub(crate) fn start_char_metrics( &mut self, rest: &str, lineno: usize, ) -> Result<(), ParseError>

Source

pub(crate) fn start_kern_pairs( &mut self, rest: &str, lineno: usize, ) -> Result<(), ParseError>

Source

pub(crate) fn start_direction( &mut self, rest: &str, lineno: usize, ) -> Result<(), ParseError>

Auto Trait Implementations§

§

impl<'a> Freeze for ParseAccumulator<'a>

§

impl<'a> RefUnwindSafe for ParseAccumulator<'a>

§

impl<'a> Send for ParseAccumulator<'a>

§

impl<'a> Sync for ParseAccumulator<'a>

§

impl<'a> Unpin for ParseAccumulator<'a>

§

impl<'a> UnsafeUnpin for ParseAccumulator<'a>

§

impl<'a> UnwindSafe for ParseAccumulator<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.