Struct FontFace

Source
pub struct FontFace { /* private fields */ }
Expand description

Font Face

Implementations§

Source§

impl FontFace

Source

pub fn from_path<P: AsRef<Path>>( path: P, read_flags: DataAccessFlags, ) -> Result<Self>

Creates a new FontFace from a given path.

Source

pub fn from_loader(loader: &FontLoader, face_index: u32) -> Result<Self>

Creates a new FontFace from the given FontLoader.

Source

pub fn create_font(&self, size: f32) -> Result<Font>

Creates a new Font from this FontFace.

Source

pub fn face_info(&self) -> &FontFaceInfo

Returns the FontFaceInfo.

Source

pub fn face_type(&self) -> FontFaceType

Returns the FontFaceType.

Source

pub fn face_flags(&self) -> FontFaceFlags

Returns the FontFaceFlags.

Source

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.

Source

pub fn outline_type(&self) -> FontOutlineType

Returns the FontOutlineType.

Source

pub fn glyph_count(&self) -> u32

Returns the number of glyphs the face provides.

Source

pub fn diag_flags(&self) -> FontFaceDiagFlags

Returns the FontFaceDiagFlags.

Source

pub fn face_unique_id(&self) -> u64

Returns a unique identifier describing this FontFace.

Source

pub fn weight(&self) -> FontWeight

Returns the FontWeight.

Source

pub fn stretch(&self) -> FontStretch

Returns the FontStretch.

Source

pub fn style(&self) -> FontStyle

Returns the FontStyle.

Source

pub fn data(&self) -> &FontData

Returns the FontData associated with this font-face.

Source

pub fn loader(&self) -> &FontLoader

Returns the FontLoader associated with this font-face.

Source

pub fn design_metrics(&self) -> &FontDesignMetrics

Returns the design metrics of this FontFace.

Source

pub fn units_per_em(&self) -> i32

Returns the units per em, which are part of font’s design metrics.

Source

pub fn unicode_coverage(&self) -> &FontUnicodeCoverage

Source

pub fn full_name(&self) -> &str

Returns the full name.

Source

pub fn family_name(&self) -> &str

Returns the family name.

Source

pub fn subfamily_name(&self) -> &str

Returns the subfamily name.

Source

pub fn post_script_name(&self) -> &str

Returns the post script name.

Trait Implementations§

Source§

impl Clone for FontFace

Source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FontFace

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for FontFace

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl PartialEq for FontFace

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ArrayType for T
where T: WrappedBlCore,