Skip to main content

CharstringContext

Trait CharstringContext 

Source
pub trait CharstringContext {
    // Required methods
    fn kind(&self) -> CharstringKind;
    fn seac_components(
        &self,
        base_code: i32,
        accent_code: i32,
    ) -> Result<[&[u8]; 2], Error>;
    fn global_subr(&self, index: i32) -> Result<&[u8], Error>;
    fn subr(&self, index: i32) -> Result<&[u8], Error>;

    // Provided methods
    fn weight_vector(&self) -> &[Fixed] { ... }
    fn build_char_len(&self) -> usize { ... }
}
Expand description

Trait that provides context for charstring evaluation.

Required Methods§

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 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 subr(&self, index: i32) -> Result<&[u8], Error>

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

Provided Methods§

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.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'a> CharstringContext for (&'a [u8], &'a Index<'a>, &'a Index<'a>, &'a Index<'a>)

Source§

fn kind(&self) -> CharstringKind

Source§

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

Source§

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

Source§

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

Implementors§