Skip to main content

Type1Instance

Struct Type1Instance 

Source
pub struct Type1Instance<'a> {
    font: &'a Type1Font,
    weights: &'a [Fixed],
}
Expand description

A Type 1 font drawn with a given blend of its masters.

For a multiple master font, the weights give the blend, one per master. MultipleMaster::blend_to_weights computes them for a position in the blend space. A font with no masters takes empty weights.

Fields§

§font: &'a Type1Font§weights: &'a [Fixed]

Implementations§

Source§

impl<'a> Type1Instance<'a>

Source

pub fn font(&self) -> &'a Type1Font

Returns the font.

Source

pub fn weights(&self) -> &'a [Fixed]

Returns the weight of each master.

Source

pub fn evaluate_width(&self, gid: GlyphId) -> Result<Option<Fixed>, Error>

As Type1Font::evaluate_width, with this instance’s blend.

Source

pub fn evaluate_charstring( &self, gid: GlyphId, sink: &mut impl CommandSink, ) -> Result<Option<Fixed>, Error>

As Type1Font::evaluate_charstring, with this instance’s blend.

Source

pub fn advance( &self, gid: GlyphId, ppem: Option<f32>, ) -> Result<Option<f32>, Error>

As Type1Font::advance, with this instance’s blend.

Source

pub fn evaluate_extents( &self, gid: GlyphId, ) -> Result<Option<BoundingBox<Fixed>>, Error>

As Type1Font::evaluate_extents, with this instance’s blend.

Source

pub fn extents( &self, gid: GlyphId, ppem: Option<f32>, ) -> Result<Option<BoundingBox<f32>>, Error>

As Type1Font::extents, with this instance’s blend.

Source

pub fn draw( &self, gid: GlyphId, ppem: Option<f32>, sink: &mut impl PathSink, ) -> Result<Option<f32>, Error>

As Type1Font::draw, with this instance’s blend.

Trait Implementations§

Source§

impl CharstringContext for Type1Instance<'_>

Source§

fn kind(&self) -> CharstringKind

Returns the type of the charstring.
Source§

fn seac_components( &self, base_code: i32, accent_code: i32, ) -> Result<[&[u8]; 2], Error>

Returns the base and accent charstrings for the seac (standard encoded accented character) operator.
Source§

fn subr(&self, index: i32) -> Result<&[u8], Error>

Returns the charstring for the local subroutine at the given index as encoded in the calling charstring.
Source§

fn global_subr(&self, index: i32) -> Result<&[u8], Error>

Returns the charstring for the global subroutine at the given index as encoded in the calling charstring.
Source§

fn weight_vector(&self) -> &[Fixed]

Returns the current active weight vector for a multiple master font.
Source§

fn build_char_len(&self) -> usize

Returns the number of elements in the BuildCharArray of a multiple master font, which othersubrs read and write.
Source§

impl<'a> Clone for Type1Instance<'a>

Source§

fn clone(&self) -> Type1Instance<'a>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for Type1Instance<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for Type1Instance<'a>

§

impl<'a> RefUnwindSafe for Type1Instance<'a>

§

impl<'a> Send for Type1Instance<'a>

§

impl<'a> Sync for Type1Instance<'a>

§

impl<'a> Unpin for Type1Instance<'a>

§

impl<'a> UnsafeUnpin for Type1Instance<'a>

§

impl<'a> UnwindSafe for Type1Instance<'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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.