pub struct FontFace { /* private fields */ }Expand description
Font Face
Implementations§
Source§impl FontFace
impl FontFace
Sourcepub fn from_path<P: AsRef<Path>>(
path: P,
read_flags: DataAccessFlags,
) -> Result<Self>
pub fn from_path<P: AsRef<Path>>( path: P, read_flags: DataAccessFlags, ) -> Result<Self>
Creates a new FontFace from a given path.
Sourcepub fn from_loader(loader: &FontLoader, face_index: u32) -> Result<Self>
pub fn from_loader(loader: &FontLoader, face_index: u32) -> Result<Self>
Creates a new FontFace from the given FontLoader.
Sourcepub fn face_info(&self) -> &FontFaceInfo
pub fn face_info(&self) -> &FontFaceInfo
Returns the FontFaceInfo.
Sourcepub fn face_type(&self) -> FontFaceType
pub fn face_type(&self) -> FontFaceType
Returns the FontFaceType.
Sourcepub fn face_flags(&self) -> FontFaceFlags
pub fn face_flags(&self) -> FontFaceFlags
Returns the FontFaceFlags.
Sourcepub fn face_index(&self) -> u32
pub fn face_index(&self) -> u32
Returns a zero-based index of this font-face.
NOTE: Face index does only make sense if this face is part of a TrueType or OpenType font collection. In that case the returned value would be the index of this face in that collection. If the face is not part of a collection then the returned value would always be zero.
Sourcepub fn outline_type(&self) -> FontOutlineType
pub fn outline_type(&self) -> FontOutlineType
Returns the FontOutlineType.
Sourcepub fn glyph_count(&self) -> u32
pub fn glyph_count(&self) -> u32
Returns the number of glyphs the face provides.
Sourcepub fn diag_flags(&self) -> FontFaceDiagFlags
pub fn diag_flags(&self) -> FontFaceDiagFlags
Returns the FontFaceDiagFlags.
Sourcepub fn face_unique_id(&self) -> u64
pub fn face_unique_id(&self) -> u64
Returns a unique identifier describing this FontFace.
Sourcepub fn weight(&self) -> FontWeight
pub fn weight(&self) -> FontWeight
Returns the FontWeight.
Sourcepub fn stretch(&self) -> FontStretch
pub fn stretch(&self) -> FontStretch
Returns the FontStretch.
Sourcepub fn loader(&self) -> &FontLoader
pub fn loader(&self) -> &FontLoader
Returns the FontLoader associated with this font-face.
Sourcepub fn design_metrics(&self) -> &FontDesignMetrics
pub fn design_metrics(&self) -> &FontDesignMetrics
Returns the design metrics of this FontFace.
Sourcepub fn units_per_em(&self) -> i32
pub fn units_per_em(&self) -> i32
Returns the units per em, which are part of font’s design metrics.
pub fn unicode_coverage(&self) -> &FontUnicodeCoverage
Sourcepub fn family_name(&self) -> &str
pub fn family_name(&self) -> &str
Returns the family name.
Sourcepub fn subfamily_name(&self) -> &str
pub fn subfamily_name(&self) -> &str
Returns the subfamily name.
Sourcepub fn post_script_name(&self) -> &str
pub fn post_script_name(&self) -> &str
Returns the post script name.