Instance Method

fractionOfDistanceThroughGlyphForPoint:inTextContainer:

Returns the fraction of the distance between the glyph at the specified point and the next glyph.

Declaration

iOS, Mac Catalyst, tvOS
- (CGFloat)fractionOfDistanceThroughGlyphForPoint:(CGPoint)point inTextContainer:(NSTextContainer *)container;
macOS
- (CGFloat)fractionOfDistanceThroughGlyphForPoint:(NSPoint)point inTextContainer:(NSTextContainer *)container;

Discussion

This method is a primitive for glyphIndexForPoint:inTextContainer:fractionOfDistanceThroughGlyph:. You should always call the main method, not the primitives.

Overriding should be done for the primitive methods. Existing subclasses that do not do this overriding will not have their implementations available to Java developers.

See Also

Performing Advanced Layout Queries

- boundingRectForGlyphRange:inTextContainer:

Returns the bounding rectangle for the specified glyphs in a container.

- characterIndexForPoint:inTextContainer:fractionOfDistanceBetweenInsertionPoints:

Returns the index of the character falling under the given point, expressed in the given container's coordinate system.

- characterRangeForGlyphRange:actualGlyphRange:

Returns the range of characters that correspond to the glyphs in the specified glyph range.

- enumerateEnclosingRectsForGlyphRange:withinSelectedGlyphRange:inTextContainer:usingBlock:

Enumerates enclosing rectangles for the specified glyph range in a text container.

- enumerateLineFragmentsForGlyphRange:usingBlock:

Enumerates line fragments intersecting with the specified glyph range.

- glyphIndexForPoint:inTextContainer:

Returns the index of the glyph at the specified location in a text container.

- glyphIndexForPoint:inTextContainer:fractionOfDistanceThroughGlyph:

Returns the index of the glyph at the specified point, expressed in the container's coordinate system.

- glyphRangeForBoundingRect:inTextContainer:

Returns the smallest contiguous range for glyphs that are laid out wholly or partially within the specified rectangle of the text container.

- glyphRangeForBoundingRectWithoutAdditionalLayout:inTextContainer:

Returns the smallest contiguous range for glyphs that are laid out wholly or partially within the specified rectangle of the text container.

- glyphRangeForTextContainer:

Returns the range of glyphs laid out within the specified text container.

- glyphRangeForCharacterRange:actualCharacterRange:

Returns the range of glyphs that are generated from the specified range of characters.

- rangeOfNominallySpacedGlyphsContainingIndex:

Returns the range of displayable glyphs that surround the glyph at the specified index.