replaceGlyph(at:withGlyph:)
Replaces the glyph at the given index with a new glyph.
Declaration
func replaceGlyph(at glyphIndex: Int, withGlyph newGlyph: NSGlyph)Parameters
- glyphIndex:
Index of the glyph to replace.
- newGlyph:
The new glyph.
Discussion
Doesn’t alter the glyph-to-character mapping or invalidate layout information. The character index of the glyph is assumed to remain the same (although it can, of course, be set explicitly if needed).
This method is for use by the glyph-generation mechanism and doesn’t perform any invalidation or generation of the glyphs or layout. This method should be invoked only during glyph generation and typesetting, in almost all cases only by the glyph generator or typesetter. For example, a custom glyph generator or typesetter might invoke it.
See Also
Methods
showCGGlyphs(_:positions:count:font:matrix:attributes:in:)invalidateGlyphs(onLayoutInvalidationForGlyphRange:)invalidateLayout(forCharacterRange:isSoft:actualCharacterRange:)textStorage(_:edited:range:changeInLength:invalidatedRange:)insertGlyph(_:atGlyphIndex:characterIndex:)insertGlyphs(_:length:forStartingGlyphAt:characterIndex:)glyph(at:)glyph(at:isValidIndex:)getGlyphs(_:range:)getGlyphs(in:glyphs:characterIndexes:glyphInscriptions:elasticBits:)getGlyphs(in:glyphs:characterIndexes:glyphInscriptions:elasticBits:bidiLevels:)deleteGlyphs(in:)setCharacterIndex(_:forGlyphAt:)intAttribute(_:forGlyphAt:)setIntAttribute(_:value:forGlyphAt:)