pub enum Glyph<'a> {
Outline(OutlineGlyph),
Type3(Box<Type3Glyph<'a>>),
}Expand description
A glyph that can be drawn.
Variants§
Outline(OutlineGlyph)
A glyph defined by an outline.
Type3(Box<Type3Glyph<'a>>)
A type3 glyph, defined by PDF drawing instructions.
Implementations§
Source§impl Glyph<'_>
impl Glyph<'_>
Sourcepub fn as_unicode(&self) -> Option<BfString>
pub fn as_unicode(&self) -> Option<BfString>
Returns the Unicode code point for this glyph, if available.
This method attempts to determine the Unicode character that this glyph represents. The exact fallback chain depends on the font type:
For Outline Fonts (Type1, TrueType, CFF):
ToUnicodecmap- Glyph name → Unicode (via Adobe Glyph List)
- Unicode naming conventions (e.g., “uni0041”, “u0041”)
For CID Fonts (Type0):
ToUnicodecmap
For Type3 Fonts:
ToUnicodecmap
Returns None if the Unicode value could not be determined.
Please note that this method is still somewhat experimental and might not work reliably in all cases.
Auto Trait Implementations§
impl<'a> Freeze for Glyph<'a>
impl<'a> !RefUnwindSafe for Glyph<'a>
impl<'a> !Send for Glyph<'a>
impl<'a> !Sync for Glyph<'a>
impl<'a> Unpin for Glyph<'a>
impl<'a> UnsafeUnpin for Glyph<'a>
impl<'a> !UnwindSafe for Glyph<'a>
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