Returns the glyphs and information needed to perform layout for the given glyph range.
SDK
- macOS 10.0–10.11Deprecated
Framework
- App
Kit
Declaration
func getGlyphs(in glyphRange: NSRange, glyphs glyphBuffer: Unsafe Mutable Pointer<NSGlyph>?, characterIndexes charIndexBuffer: Unsafe Mutable Pointer<Int>?, glyphInscriptions inscribeBuffer: Unsafe Mutable Pointer<NSGlyph Inscription>?, elasticBits elasticBuffer: Unsafe Mutable Pointer<Obj CBool>?, bidiLevels bidiLevelBuffer: Unsafe Mutable Pointer<UInt8>?) -> Int
Parameters
glyphRange
The range of glyphs to lay out.
glyphBuffer
On output, the sequence of glyphs needed to lay out the given glyph range.
charIndexBuffer
On output, the indexes of the original characters corresponding to the given glyph range. Note that a glyph at index 1 is not necessarily mapped to the character at index 1, since a glyph may be for a ligature or accent.
inscribeBuffer
On output, the inscription attributes for each glyph, which are used to lay out characters that are combined together. The possible values are described in Constants.
elasticBuffer
On output, values indicating whether a glyph is elastic for each glyph. An elastic glyph can be made longer at the end of a line or when needed for justification.
bidiLevelBuffer
On output, the direction of each glyph for bidirectional text. The values range from 0 to 61 as defined by Unicode Standard Annex #9. An even value means the glyph goes left-to-right, and an odd value means the glyph goes right-to-left.
Return Value
The number of glyphs returned in glyph
.
Discussion
This method and get
are intended primarily to enable the typesetter to obtain in bulk the glyphs and other information that it needs to perform layout. These methods return all glyphs in the range, including NSNull
and not-shown glyphs. They do not null-terminate the results. Each pointer passed in should either be NULL
, or else point to sufficient memory to hold glyph
elements.