pub enum CmapSubtable<'a> {
Format0 {
language: u16,
glyph_id_array: ReadArray<'a, U8>,
},
Format2 {
language: u16,
sub_header_keys: ReadArray<'a, U16Be>,
sub_headers: ReadArray<'a, SubHeader>,
sub_headers_scope: ReadScope<'a>,
},
Format4(CmapSubtableFormat4<'a>),
Format6 {
language: u16,
first_code: u16,
glyph_id_array: ReadArray<'a, U16Be>,
},
Format10 {
language: u32,
start_char_code: u32,
glyph_id_array: ReadArray<'a, U16Be>,
},
Format12 {
language: u32,
groups: ReadArray<'a, SequentialMapGroup>,
},
}
Variants
Format0
Format2
Format4(CmapSubtableFormat4<'a>)
Format6
Format10
Format12
Implementations
sourceimpl<'a> CmapSubtable<'a>
impl<'a> CmapSubtable<'a>
pub fn map_glyph(&self, ch: u32) -> Result<Option<u16>, ParseError>
sourcepub fn to_owned(&self) -> Option<OwnedCmapSubtable>
pub fn to_owned(&self) -> Option<OwnedCmapSubtable>
Returns an owned::CmapSubtable
. Will only return None
if self
is
CmapSubtable::Format2
as support for converting from this format is not yet implemented.
sourcepub fn mappings_fn(
&self,
callback: impl FnMut(u32, u16)
) -> Result<(), ParseError>
pub fn mappings_fn(
&self,
callback: impl FnMut(u32, u16)
) -> Result<(), ParseError>
Extract all the mappings from the sub-table.
Trait Implementations
sourceimpl<'a> ReadBinary<'a> for CmapSubtable<'a>
impl<'a> ReadBinary<'a> for CmapSubtable<'a>
type HostType = CmapSubtable<'a>
fn read(ctxt: &mut ReadCtxt<'a>) -> Result<Self, ParseError>
sourceimpl<'a> WriteBinary<&CmapSubtable<'a>> for CmapSubtable<'a>
impl<'a> WriteBinary<&CmapSubtable<'a>> for CmapSubtable<'a>
sourcefn write<C: WriteContext>(
ctxt: &mut C,
table: &CmapSubtable<'a>
) -> Result<(), WriteError>
fn write<C: WriteContext>(
ctxt: &mut C,
table: &CmapSubtable<'a>
) -> Result<(), WriteError>
Write the binary representation of Self to
ctxt
.Auto Trait Implementations
impl<'a> RefUnwindSafe for CmapSubtable<'a>
impl<'a> Send for CmapSubtable<'a>
impl<'a> Sync for CmapSubtable<'a>
impl<'a> Unpin for CmapSubtable<'a>
impl<'a> UnwindSafe for CmapSubtable<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<'a, T> ReadBinaryDep<'a> for Twhere
T: ReadBinary<'a>,
impl<'a, T> ReadBinaryDep<'a> for Twhere
T: ReadBinary<'a>,
type Args = ()
type HostType = <T as ReadBinary<'a>>::HostType
fn read_dep(
ctxt: &mut ReadCtxt<'a>,
<T as ReadBinaryDep<'a>>::Args
) -> Result<<T as ReadBinaryDep<'a>>::HostType, ParseError>
sourceimpl<T, HostType> WriteBinaryDep<HostType> for Twhere
T: WriteBinary<HostType>,
impl<T, HostType> WriteBinaryDep<HostType> for Twhere
T: WriteBinary<HostType>,
type Output = <T as WriteBinary<HostType>>::Output
type Output = <T as WriteBinary<HostType>>::Output
The type of the value returned by
write_dep
.sourcefn write_dep<C>(
ctxt: &mut C,
val: HostType,
<T as WriteBinaryDep<HostType>>::Args
) -> Result<<T as WriteBinaryDep<HostType>>::Output, WriteError>where
C: WriteContext,
fn write_dep<C>(
ctxt: &mut C,
val: HostType,
<T as WriteBinaryDep<HostType>>::Args
) -> Result<<T as WriteBinaryDep<HostType>>::Output, WriteError>where
C: WriteContext,
Write the binary representation of Self to
ctxt
.