Calculates subranges to be underlined for the glyphs in a given range and draws the underlining as appropriate.
- iOS 7.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
A range of glyphs, which must belong to a single line fragment rectangle (as returned by
Fragment Rect(for Glyph At: effective Range:)
The style of underlining to draw. This value is a mask derived from the value for
(NSUnderline. Subclasses can define custom underlining styles.
Pattern Dash | NSUnderline Style Thick | NSUnderline By Word Mask)
The line fragment rectangle containing the glyphs to draw underlining for.
The range of all glyphs within that line fragment rectangle.
The origin of the line fragment rectangle’s
This method determines which glyphs actually need to be underlined based on
NSUnderline, for example, leading and trailing whitespace isn’t underlined, but whitespace between visible glyphs is. A potential word-underline style would omit underlining on any whitespace. After determining which glyphs to draw underlining on, this method invokes
draw for each contiguous range of glyphs that requires it.