pub struct Glyph { /* private fields */ }Expand description
A single glyph in a font
Implementations§
Source§impl Glyph
impl Glyph
Sourcepub const fn new(
codepoint: u32,
name: &'static str,
preview: GlyphPreview,
) -> Self
pub const fn new( codepoint: u32, name: &'static str, preview: GlyphPreview, ) -> Self
Creates a new glyph with the specified codepoint, name, and preview data
Sourcepub fn unicode_range(&self) -> &'static str
pub fn unicode_range(&self) -> &'static str
Returns the unicode range for the glyph
Sourcepub fn outline(&self) -> &GlyphPreview
pub fn outline(&self) -> &GlyphPreview
Returns the raw visual data of this glyph
Compound glyphs will be simplified to a single outline
Sourcepub fn svg_preview(&self) -> String
pub fn svg_preview(&self) -> String
Returns the SVG data of this glyph’s outline
Sourcepub fn svgz_preview(&self) -> Result<Vec<u8>>
Available on crate feature extended-svg only.
pub fn svgz_preview(&self) -> Result<Vec<u8>>
extended-svg only.Returns the gzip compressed SVGZ data of this glyph
§Errors
Returns an error if the data cannot be compressed
Sourcepub fn svg_dataimage_url(&self) -> Result<String>
Available on crate feature extended-svg only.
pub fn svg_dataimage_url(&self) -> Result<String>
extended-svg only.Generates a data:image link containing the svg data for this glyph
§Errors
Returns an error if the data cannot be encoded properly
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Glyph
impl RefUnwindSafe for Glyph
impl Send for Glyph
impl Sync for Glyph
impl Unpin for Glyph
impl UnwindSafe for Glyph
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