ComposedFrame
public class ComposedFrame
Represents a frame containing multiple lines of text. It is the output resulting from text-framing process performed by a typesetter.
-
The UTF-16 range of this frame in source string.
Declaration
Swift
public let codeUnitRange: Range<Int> -
The index to the first character of this frame in source string.
Declaration
Swift
public var startIndex: String.Index { get } -
The index after the last character of this frame in source string.
Declaration
Swift
public var endIndex: String.Index { get } -
The width of this frame.
Declaration
Swift
public internal(set) var width: CGFloat { get } -
The height of this frame.
Declaration
Swift
public internal(set) var height: CGFloat { get } -
The array containing all the lines of this frame.
Declaration
Swift
public let lines: [ComposedLine] -
Returns the index of line containing the specified UTF-16 code unit index.
Declaration
Swift
public func indexOfLine(forCodeUnitAt index: Int) -> IntParameters
indexThe index of UTF-16 code unit for which to return the line index.
Return Value
The index of line containing the specified UTF-16 code unit index.
-
Returns the index of line containing the specified character index.
Declaration
Swift
public func indexOfLine(forCharacterAt index: String.Index) -> IntParameters
indexThe index of character for which to return the line index.
Return Value
The index of line containing the specified character index.
-
Returns the index of a suitable line representing the specified position.
Declaration
Swift
public func indexOfLine(at position: CGPoint) -> IntParameters
positionThe position for which to return the line index.
Return Value
The index of a suitable line representing the specified position.
-
Creates a path that contains a set of rectangles covering the specified UTF-16 code unit range.
Declaration
Swift
public func selectionPath(forCodeUnitRange codeUnitRange: Range<Int>) -> CGPathParameters
codeUnitRangeThe selection range in source string.
Return Value
A path that contains a set of rectangles covering the specified UTF-16 range.
-
Creates a path that contains a set of rectangles covering the specified character range.
Declaration
Swift
public func selectionPath(forCharacterRange characterRange: Range<String.Index>) -> CGPathParameters
characterRangeThe selection range in source string.
Return Value
A path that contains a set of rectangles covering the specified character range.
-
Draws this frame in the
contextwith the specified renderer.Declaration
Swift
public func draw(with renderer: Renderer, in context: CGContext, at point: CGPoint)Parameters
rendererThe renderer with which to draw the frame.
contextThe context in which to draw the frame.
pointThe position at which to draw the frame.
View on GitHub
Install in Dash
ComposedFrame Class Reference