pub struct CMap { /* private fields */ }Expand description
A parsed cmap.
Implementations§
Source§impl CMap
impl CMap
Sourcepub fn parse<'a>(
data: &[u8],
get_cmap: impl Fn(CMapName<'_>) -> Option<&'a [u8]> + Clone + 'a,
) -> Option<Self>
pub fn parse<'a>( data: &[u8], get_cmap: impl Fn(CMapName<'_>) -> Option<&'a [u8]> + Clone + 'a, ) -> Option<Self>
Parse a cmap from raw bytes.
The get_cmap callback is used to recursively resolve cmaps that
are referenced via usecmap.
Sourcepub fn identity_h() -> Self
pub fn identity_h() -> Self
Create an Identity-H cmap.
Sourcepub fn identity_v() -> Self
pub fn identity_v() -> Self
Create an Identity-V cmap.
Sourcepub fn lookup_cid_code(&self, code: u32, byte_len: u8) -> Option<Cid>
pub fn lookup_cid_code(&self, code: u32, byte_len: u8) -> Option<Cid>
Look up the CID code of a character code.
Returns None if the code does not match any range for the given byte length.
Sourcepub fn lookup_bf_string(&self, code: u32) -> Option<BfString>
pub fn lookup_bf_string(&self, code: u32) -> Option<BfString>
Look up a bf string in the cmap. This is usually
used for mapping character codes to Unicode codepoints in a
ToUnicode cmap.
Returns None if no mapping is available.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CMap
impl RefUnwindSafe for CMap
impl Send for CMap
impl Sync for CMap
impl Unpin for CMap
impl UnsafeUnpin for CMap
impl UnwindSafe for CMap
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