Contents

drawsOutsideLineFragment(forGlyphAt:)

Indicates whether the glyph draws outside its line fragment rectangle.

Declaration

func drawsOutsideLineFragment(forGlyphAt glyphIndex: Int) -> Bool

Parameters

  • glyphIndex:

    Index of the glyph.

Return Value

true if the glyph at glyphIndex exceeds the bounds of the line fragment where it’s laid out, false otherwise.

Discussion

Exceeding bounds can happen when text is set at a fixed line height. For example, if the user specifies a fixed line height of 12 points and sets the font size to 24 points, the glyphs will exceed their layout rectangles.

This method causes glyph generation and layout for the line fragment containing the specified glyph, or if noncontiguous layout is not enabled, up to and including that line fragment.

Glyphs that draw outside their line fragment rectangles aren’t considered when calculating enclosing rectangles with the rectArray(forCharacterRange:withinSelectedCharacterRange:in:rectCount:) and rectArray(forGlyphRange:withinSelectedGlyphRange:in:rectCount:) methods. They are, however, considered by boundingRect(forGlyphRange:in:).

See Also

Getting layout information