pub struct GlyphMap { /* private fields */ }
Expand description
A glyph map for mapping from raw glyph identifiers to numeral GlyphId16
s.
This is used to map from names or CIDS encountered in a FEA file to the actual GlyphId16s that will be used in the final font.
Currently, the only way to construct this type is by calling collect()
on an iterator of cids or names.
Implementations§
Source§impl GlyphMap
impl GlyphMap
Sourcepub fn reverse_map(&self) -> BTreeMap<GlyphId16, GlyphIdent>
pub fn reverse_map(&self) -> BTreeMap<GlyphId16, GlyphIdent>
Generates a reverse map of ids -> raw identifers (names or CIDs)
Sourcepub fn iter(&self) -> impl Iterator<Item = GlyphIdent> + '_
pub fn iter(&self) -> impl Iterator<Item = GlyphIdent> + '_
Iterate the idents in this map, in GID order.
This is really only intended to be used to create new glyphmaps for testing.
Sourcepub fn contains<Q: ?Sized + AsGlyphIdent>(&self, key: &Q) -> bool
pub fn contains<Q: ?Sized + AsGlyphIdent>(&self, key: &Q) -> bool
Return true
if the map contains the provided GlyphIdent
.
Sourcepub fn get<Q: ?Sized + AsGlyphIdent>(&self, key: &Q) -> Option<GlyphId16>
pub fn get<Q: ?Sized + AsGlyphIdent>(&self, key: &Q) -> Option<GlyphId16>
Return the GlyphId16
for the provided GlyphIdent
Sourcepub fn make_post_table(&self) -> Post
pub fn make_post_table(&self) -> Post
Generate a post table from this glyph map
Trait Implementations§
Source§impl FromIterator<GlyphIdent> for GlyphMap
impl FromIterator<GlyphIdent> for GlyphMap
Source§fn from_iter<T: IntoIterator<Item = GlyphIdent>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = GlyphIdent>>(iter: T) -> Self
Creates a value from an iterator. Read more
Source§impl FromIterator<GlyphName> for GlyphMap
impl FromIterator<GlyphName> for GlyphMap
Source§impl FromIterator<u16> for GlyphMap
impl FromIterator<u16> for GlyphMap
impl StructuralPartialEq for GlyphMap
Auto Trait Implementations§
impl Freeze for GlyphMap
impl RefUnwindSafe for GlyphMap
impl Send for GlyphMap
impl Sync for GlyphMap
impl Unpin for GlyphMap
impl UnwindSafe for GlyphMap
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
Convert this type into
T
, using the provided data to resolve any offsets.