pub struct Cmap {
pub encoding_records: Vec<EncodingRecord>,
}tables only.Expand description
Fields§
§encoding_records: Vec<EncodingRecord>Implementations§
Source§impl Cmap
impl Cmap
Sourcepub fn from_mappings(
mappings: impl IntoIterator<Item = (char, GlyphId)>,
) -> Result<Cmap, CmapConflict>
pub fn from_mappings( mappings: impl IntoIterator<Item = (char, GlyphId)>, ) -> Result<Cmap, CmapConflict>
Generates a [‘cmap’] that is expected to work in most modern environments.
The input is not required to be sorted.
This emits format 4 and format 12 subtables, respectively for the Basic Multilingual Plane and Full Unicode Repertoire.
The format 4 subtable is omitted if it can’t represent every mapping in the BMP: that is, if it would be longer than 65535 bytes, or if a BMP char is mapped to a glyph id above 65535. In that case we log a warning, and the format 12 subtable contains all of the mappings, and is emitted even if every char is in the BMP. The spec doesn’t require a format 4 alongside a format 12, and says that if both are present their BMP mappings should be identical, which rules out a partial format 4.
Also see: https://learn.microsoft.com/en-us/typography/opentype/spec/recom#cmap-table
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Cmap
Available on crate feature serde only.
impl<'de> Deserialize<'de> for Cmap
serde only.Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Cmap
Source§impl<'a> FontRead<'a> for Cmap
impl<'a> FontRead<'a> for Cmap
Source§impl FontWrite for Cmap
impl FontWrite for Cmap
Source§fn write_into(&self, writer: &mut TableWriter)
fn write_into(&self, writer: &mut TableWriter)
Source§fn table_type(&self) -> TableType
fn table_type(&self) -> TableType
Source§impl<'a> FromObjRef<Cmap<'a>> for Cmap
impl<'a> FromObjRef<Cmap<'a>> for Cmap
Source§fn from_obj_ref(obj: &Cmap<'a>, _: FontData<'_>) -> Self
fn from_obj_ref(obj: &Cmap<'a>, _: FontData<'_>) -> Self
from to an instance of Self, using the provided data to resolve offsets.Source§impl<'a> FromTableRef<Cmap<'a>> for Cmap
impl<'a> FromTableRef<Cmap<'a>> for Cmap
fn from_table_ref(from: &T) -> Self
Source§impl Ord for Cmap
impl Ord for Cmap
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for Cmap
impl PartialOrd for Cmap
impl StructuralPartialEq for Cmap
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
tables only.T, using the provided data to resolve any offsets.Source§impl<U, T> ToOwnedTable<U> for Twhere
U: FromTableRef<T>,
impl<U, T> ToOwnedTable<U> for Twhere
U: FromTableRef<T>,
Source§fn to_owned_table(&self) -> U
fn to_owned_table(&self) -> U
tables only.