Struct theme_parser::parser::pff2::Pff2
source · pub struct Pff2<T: FontValidation> {
pub name: String,
pub family: String,
pub point_size: u16,
pub weight: String,
pub max_char_width: u16,
pub max_char_height: u16,
pub ascent: u16,
pub descent: u16,
pub leading: u16,
pub glyphs: OwnedSlice<[Glyph]>,
/* private fields */
}
Expand description
Fields§
§name: String
Font name. Usually includes family, point size and weight
family: String
Font family
point_size: u16
Size of the font
weight: String
Weight could be anything like normal, bold or italic
max_char_width: u16
The dimetions of the glyphs
max_char_height: u16
The dimetions of the glyphs
ascent: u16
The highest point on the glyph (like the top of M
)
descent: u16
The lowest point on the glyph (like the bottom of g
)
leading: u16
The distance between baselines
glyphs: OwnedSlice<[Glyph]>
A list of glyphs that are in the font
Implementations§
source§impl Pff2<Unchecked>
impl Pff2<Unchecked>
sourcepub fn validate(self) -> Result<Font, FontValidationError>
pub fn validate(self) -> Result<Font, FontValidationError>
Validates Self
to be a valid font that can be used for rendering. See FontValidationError
for reasons a
font may be invalid.
Trait Implementations§
source§impl<T: FontValidation> Default for Pff2<T>
impl<T: FontValidation> Default for Pff2<T>
source§impl<T: PartialEq + FontValidation> PartialEq for Pff2<T>
impl<T: PartialEq + FontValidation> PartialEq for Pff2<T>
impl<T: Eq + FontValidation> Eq for Pff2<T>
impl<T: FontValidation> StructuralEq for Pff2<T>
impl<T: FontValidation> StructuralPartialEq for Pff2<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for Pff2<T>where
T: RefUnwindSafe,
impl<T> !Send for Pff2<T>
impl<T> !Sync for Pff2<T>
impl<T> Unpin for Pff2<T>where
T: Unpin,
impl<T> UnwindSafe for Pff2<T>where
T: UnwindSafe,
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
Mutably borrows from an owned value. Read more