Instance Method

characterBoundsAtIndex:

Returns the bounds, in page space, of the character at the specified index.

Declaration

iOS, Mac Catalyst
- (CGRect)characterBoundsAtIndex:(NSInteger)index;
macOS
- (NSRect)characterBoundsAtIndex:(NSInteger)index;

Discussion

In the unlikely event that there is more than one character at the specified index point, only the bounds of the first character is returned.

Page space is a 72 dpi coordinate system with the origin at the lower-left corner of the current page. Note that the bounds returned are not guaranteed to have integer coordinates.

See Also

Working with Textual Content

numberOfCharacters

Returns the number of characters on the page, including whitespace characters.

string

Returns an NSString object representing the text on the page.

attributedString

Returns an NSAttributedString object representing the text on the page.

- characterIndexAtPoint:

Returns the character index value for the specified point in page space.