Function

CTRunGetTypographicBounds

Gets the typographic bounds of the run.

Declaration

double CTRunGetTypographicBounds(CTRunRef run, CFRange range, CGFloat *ascent, CGFloat *descent, CGFloat *leading);

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

CTLineGetBoundsWithOptions

Calculates the bounds for a line.

CTRunGetImageBounds

Calculates the image bounds for a glyph range.

CTRunGetBaseAdvancesAndOrigins

Copies a range of base advances and origins into user-provided buffers.