pub struct Compilation {
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>,
pub gdef_classes: Option<HashMap<GlyphId16, GlyphClassDef>>,
/* private fields */
}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§
§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
gdef_classes: Option<HashMap<GlyphId16, GlyphClassDef>>Any explicit gdef classes declared in the FEA.
This is provided so that the user can reference them if they are going to manually generate kerning or markpos lookups.
Implementations§
Source§impl Compilation
impl Compilation
Sourcepub fn has_non_layout_tables(&self) -> bool
pub fn has_non_layout_tables(&self) -> bool
Returns true if the FEA generated tables other than GSUB, GPOS & GDEF.
Sourcepub fn remap_name_ids(&mut self, first_avail_id: u16)
pub fn remap_name_ids(&mut self, first_avail_id: u16)
Remap any NameIds in the name table and anywhere they are referenced.
This is used for merging the results of our compilation with other
compilation operations which may have occured elsewhere, and which may
have used the same NameIds as us for different strings.
We will take all the name ids we have declared that are >= 256 and offset
them to start at first_avail_id.
Sourcepub fn to_font_builder(&self) -> Result<FontBuilder<'_>, BuilderError>
pub fn to_font_builder(&self) -> Result<FontBuilder<'_>, BuilderError>
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.
Auto Trait Implementations§
impl Freeze for Compilation
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.