pub struct FontSpec { /* private fields */ }Expand description
A parsed XeTeX font spec, the engine shapes with its name, script, language and features only.
Implementations§
Source§impl FontSpec
impl FontSpec
Sourcepub fn parse(spec: &str, size: Length) -> Self
pub fn parse(spec: &str, size: Length) -> Self
Parses a spec as XeTeX’s splitFontName and loadOTfont read it, size is the loaded size.
Sourcepub fn name(&self) -> &str
pub fn name(&self) -> &str
File name inside [...] without the face index, or the bare font name.
Sourcepub fn is_file(&self) -> bool
pub fn is_file(&self) -> bool
Whether the spec names a file with [...], otherwise it is a XeTeX name lookup.
Sourcepub fn face_index(&self) -> u32
pub fn face_index(&self) -> u32
Face index of a [file:N] spec, 0 otherwise.
Sourcepub fn variants(&self) -> &[String]
pub fn variants(&self) -> &[String]
Style and renderer suffixes after /, such as B, I, OT or AAT, which the engine ignores.
Sourcepub fn features(&self) -> &[ShapeFeature]
pub fn features(&self) -> &[ShapeFeature]
OpenType features from +tag, -tag and tag=value, in spec order.
Sourcepub fn option(&self, key: &str) -> Option<&str>
pub fn option(&self, key: &str) -> Option<&str>
Value of an option the engine ignores, such as mapping, color, embolden or letterspace.
Sourcepub fn vertical(&self) -> bool
pub fn vertical(&self) -> bool
Whether the spec asks for vertical layout, which the engine ignores.
Sourcepub fn unknown_options(&self) -> &[String]
pub fn unknown_options(&self) -> &[String]
Options XeTeX would warn about as unknown.
Sourcepub fn file_candidates(&self) -> Vec<String>
pub fn file_candidates(&self) -> Vec<String>
The name, then with .otf and .ttf when extensionless, so bare TU default names resolve as files.