Instance Method

glyphIndexForCharacterAtIndex:

Returns the index of the first glyph associated with the character at the specified index.

Declaration

- (NSUInteger)glyphIndexForCharacterAtIndex:(NSUInteger)charIndex;

Parameters

charIndex

The index of the character for which to return the associated glyph.

Return Value

The index of the first glyph associated with the character at the specified index.

Discussion

If noncontiguous layout is not enabled, this method causes generation of all glyphs up to and including those associated with the specified character. This method accepts an index beyond the last character, returning an index extrapolated from the last actual character index.

In many cases it’s better to use the range-mapping methods, characterRangeForGlyphRange:actualGlyphRange: and glyphRangeForCharacterRange:actualCharacterRange:, which provide more comprehensive information.

See Also

Accessing Glyphs

- getGlyphsInRange:glyphs:properties:characterIndexes:bidiLevels:

Fills a passed-in buffer with a sequence of glyphs.

- CGGlyphAtIndex:

Returns the glyph at the specified index.

- CGGlyphAtIndex:isValidIndex:

Returns the glyph at the specified index and information about whether the glyph index is valid.

- setGlyphs:properties:characterIndexes:font:forGlyphRange:

Stores the initial glyphs and glyph properties for a character range.

- characterIndexForGlyphAtIndex:

Returns the index in the text storage for the first character associated with the given glyph.

- isValidGlyphIndex:

Indicates whether the specified index refers to a valid glyph, otherwise NO.

numberOfGlyphs

The number of glyphs in the receiver.

- propertyForGlyphAtIndex:

Returns the glyph property associated with the glyph at the specified index.