CTFontGetGlyphsForCharacters(_:_:_:_:)
Performs basic character-to-glyph mapping.
Declaration
func CTFontGetGlyphsForCharacters(_ font: CTFont, _ characters: UnsafePointer<UniChar>, _ glyphs: UnsafeMutablePointer<CGGlyph>, _ count: CFIndex) -> BoolParameters
- font:
The font reference.
- characters:
An array of Unicode characters.
- glyphs:
On output, points to an array of glyph values.
- count:
The capacity of the character and glyph arrays.
Return Value
True if the font could encode all Unicode characters; otherwise False.
Discussion
Provides basic Unicode encoding for the given font, returning by reference an array of CGGlyph values corresponding to a given array of Unicode characters for the given font.
If a glyph could not be encoded, a value of 0 is passed back at the corresponding index in the glyphs array and the function returns False. It is the responsibility of the caller to handle the Unicode properties of the input characters.