pub struct VectorFont { /* private fields */ }Implementations§
Source§impl VectorFont
impl VectorFont
Sourcepub fn from_path(path: &str) -> Result<Self, String>
pub fn from_path(path: &str) -> Result<Self, String>
Load a font from a TTF/OTF file using its default weight.
Sourcepub fn from_path_weight(path: &str, weight: Option<f32>) -> Result<Self, String>
pub fn from_path_weight(path: &str, weight: Option<f32>) -> Result<Self, String>
Load a font, optionally pinning the variable-font weight axis (wght).
The glyph cache lives at cache/fonts/<file-stem>[@<weight>]/.
pub fn from_bytes( bytes: Vec<u8>, name: &str, weight: Option<f32>, ) -> Result<Self, String>
pub fn ascent(&self) -> f32
pub fn descent(&self) -> f32
Sourcepub fn glyph_outline(&mut self, ch: char, tol_em: f32) -> GlyphOutline
pub fn glyph_outline(&mut self, ch: char, tol_em: f32) -> GlyphOutline
Flattened outline of ch, with curves subdivided so the deviation stays
under tol_em (express your pixel tolerance as tol_px / px).
Auto Trait Implementations§
impl Freeze for VectorFont
impl RefUnwindSafe for VectorFont
impl Send for VectorFont
impl Sync for VectorFont
impl Unpin for VectorFont
impl UnsafeUnpin for VectorFont
impl UnwindSafe for VectorFont
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