Struct opentype::Font

source ·
pub struct Font {
    pub offset_table: OffsetTable,
}
Expand description

A font.

Fields§

§offset_table: OffsetTable

The offset table.

Implementations§

Read a font.

Examples found in repository?
src/file.rs (line 21)
16
17
18
19
20
21
22
23
    pub fn read<T: Read + Seek>(tape: &mut T) -> Result<File> {
        if Tag::from(Tape::peek::<u32>(tape)?) == Tag(*b"ttcf") {
            raise!("TrueType collections are not supported yet");
        }
        Ok(File {
            fonts: vec![Font::read(tape)?],
        })
    }

Find, verify, and read a table.

Find, verify, and read a table given a parameter.

Examples found in repository?
src/font.rs (line 31)
26
27
28
29
30
31
32
    pub fn take<'l, T, U>(&self, tape: &mut T) -> Result<Option<U>>
    where
        T: Read + Seek,
        U: Table<'l, Parameter = ()>,
    {
        self.take_given(tape, ())
    }

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.