Trait read_fonts::FontRead
source · pub trait FontRead<'a>: Sized {
// Required method
fn read(data: FontData<'a>) -> Result<Self, ReadError>;
}
Expand description
A type that can be read from raw table data.
This trait is implemented for all font tables that are self-describing: that
is, tables that do not require any external state in order to interpret their
underlying bytes. (Tables that require external state implement
FontReadWithArgs
instead)
Required Methods§
sourcefn read(data: FontData<'a>) -> Result<Self, ReadError>
fn read(data: FontData<'a>) -> Result<Self, ReadError>
Read an instace of Self
from the provided data, performing validation.
In the case of a table, this method is responsible for ensuring the input data is consistent: this means ensuring that any versioned fields are present as required by the version, and that any array lengths are not out-of-bounds.
Object Safety§
This trait is not object safe.