Function

CTRunGetTypographicBounds(_:_:_:_:_:)

Gets the typographic bounds of the run.

Declaration

func CTRunGetTypographicBounds(_ run: CTRun, _ range: CFRange, _ ascent: UnsafeMutablePointer<CGFloat>?, _ descent: UnsafeMutablePointer<CGFloat>?, _ leading: UnsafeMutablePointer<CGFloat>?) -> Double

Parameters

run

The run for which to calculate the typographic bounds.

range

The portion of the run to measure. If the length of the range is set to 0, then the measure operation continues from the range's start index to the end of the run.

ascent

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

descent

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

leading

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

Return Value

The typographic width of the run, or if run or range is invalid, 0.

See Also

Measuring the Glyph Run

func CTRunGetImageBounds(CTRun, CGContext?, CFRange) -> CGRect

Calculates the image bounds for a glyph range.

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