insertGlyph(_:atGlyphIndex:characterIndex:)
Enables the typesetter to insert a new glyph into the stream.
Declaration
func insertGlyph(_ glyph: NSGlyph, atGlyphIndex glyphIndex: Int, characterIndex: Int)Parameters
- glyph:
The glyph to insert into the glyph cache.
- glyphIndex:
The index at which to insert
glyph. - characterIndex:
The index of the character that
glyphmaps to. If the glyph is mapped to several characters,charIndexshould indicate the first character to which it’s mapped.
Discussion
The standard typesetter uses this method for inserting hyphenation glyphs. Because this method keeps the glyph caches synchronized, subclasses should always use this method to insert glyphs instead of calling layoutManager directly.
A subclass can override this method to interact with custom glyph storage.