Contents

glyph(at:)

Returns the glyph at the specified index.

Declaration

func glyph(at glyphIndex: Int) -> CGGlyph

Parameters

  • glyphIndex:

    The index of a glyph in the receiver. This value must not exceed the bounds of the receiver’s glyph array.

Return Value

The glyph at glyphIndex.

Discussion

Raises an NSRangeException if glyphIndex is out of bounds.

Performs glyph generation if needed. To avoid an exception with glyph(at:) you must first check the glyph index against the number of glyphs, which requires generating all glyphs. Another method, glyph(at:isValidIndex:), generates glyphs only up to the one requested, so using it can be more efficient.

See Also

Methods