layoutManager(_:shouldGenerateGlyphs:properties:characterIndexes:font:forGlyphRange:)
Enables customization of the initial glyph generation process.
Declaration
optional func layoutManager(_ layoutManager: NSLayoutManager, shouldGenerateGlyphs glyphs: UnsafePointer<CGGlyph>, properties props: UnsafePointer<NSLayoutManager.GlyphProperty>, characterIndexes charIndexes: UnsafePointer<Int>, font aFont: NSFont, forGlyphRange glyphRange: NSRange) -> IntParameters
- layoutManager:
The layout manager doing the layout.
- glyphs:
A pointer to the layout manager’s glyph cache.
- props:
A pointer to a buffer containing glyph properties for the glyphs in the cache.
- charIndexes:
A pointer to the starting index for the characters in the text storage for which glyphs are generated.
- aFont:
A font to override the font attributes in the text storage for the specified character range.
- glyphRange:
The range of glyphs in the glyph cache to set.
Return Value
The actual glyph range stored in this method. By returning 0, it can indicate for the layout manager to do the default processing.
Discussion
This message is sent whenever the layout manager is about to store the initial glyph information via setGlyphs(_:properties:characterIndexes:font:forGlyphRange:). To customize the initial glyph generation process, this method can invoke setGlyphs(_:properties:characterIndexes:font:forGlyphRange:) with modified glyph information.