Function

CTLineGetTypographicBounds(_:_:_:_:)

Calculates the typographic bounds of a line.

Declaration

func CTLineGetTypographicBounds(_ line: CTLine, _ ascent: UnsafeMutablePointer<CGFloat>?, _ descent: UnsafeMutablePointer<CGFloat>?, _ leading: UnsafeMutablePointer<CGFloat>?) -> Double

Parameters

line

The line whose typographic bounds are calculated.

ascent

On output, the ascent of the line. This parameter can be set to NULL if not needed.

descent

On output, the descent of the line. This parameter can be set to NULL if not needed.

leading

On output, the leading of the line. This parameter can be set to NULL if not needed.

Return Value

The typographic width of the line. If the line is invalid, this function returns 0.

See Also

Measuring Lines

func CTLineGetImageBounds(CTLine, CGContext?) -> CGRect

Calculates the image bounds for a line.

func CTLineGetTrailingWhitespaceWidth(CTLine) -> Double

Returns the trailing whitespace width for a line.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software