Struct fea_rs::compile::Compilation
source · pub struct Compilation {
pub warnings: Vec<Diagnostic>,
pub head: Option<Head>,
pub hhea: Option<Hhea>,
pub vhea: Option<Vhea>,
pub os2: Option<Os2>,
pub gdef: Option<Gdef>,
pub base: Option<Base>,
pub name: Option<Name>,
pub stat: Option<Stat>,
pub gsub: Option<Gsub>,
pub gpos: Option<Gpos>,
}Expand description
The tables generated by this compilation.
All tables are optional, and the set of tables that are present depends on the input file.
Each table is a type defined in the [write-fonts][] crate. The caller
may either interact with these directly, or else they may use the to_binary
method to generate a binary font.
Fields§
§warnings: Vec<Diagnostic>Any warnings encountered during parsing or compilation
head: Option<Head>The head table, if one was generated
hhea: Option<Hhea>The hhea table, if one was generated
vhea: Option<Vhea>The vhea table, if one was generated
os2: Option<Os2>The OS/2 table, if one was generated
gdef: Option<Gdef>The GDEF table, if one was generated
base: Option<Base>The BASE table, if one was generated
name: Option<Name>The name table, if one was generated
stat: Option<Stat>The STAT table, if one was generated
gsub: Option<Gsub>The GSUB table, if one was generated
gpos: Option<Gpos>The GPOS table, if one was generated
Implementations§
source§impl Compilation
impl Compilation
sourcepub fn to_font_builder(&self) -> Result<FontBuilder<'_>, BinaryCompilationError>
pub fn to_font_builder(&self) -> Result<FontBuilder<'_>, BinaryCompilationError>
Assemble the output tables into a FontBuilder.
This is a convenience method. To compile a binary font you can use
to_binary instead, and for more fine-grained control you can inspect
and manipulate the raw tables directly.
sourcepub fn to_binary(
&self,
glyph_map: &GlyphMap,
opts: Opts
) -> Result<Vec<u8>, BinaryCompilationError>
pub fn to_binary( &self, glyph_map: &GlyphMap, opts: Opts ) -> Result<Vec<u8>, BinaryCompilationError>
Compile the output tables into a font.
This is a convenience method used for things like testing; if you are building a font compiler you will probably prefer to manipulate the generated tables directly.
Auto Trait Implementations§
impl RefUnwindSafe for Compilation
impl Send for Compilation
impl Sync for Compilation
impl Unpin for Compilation
impl UnwindSafe for Compilation
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere U: FromObjRef<T>,
source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.