Function

CTLineCreateJustifiedLine(_:_:_:)

Creates a justified line from an existing line.

Declaration

func CTLineCreateJustifiedLine(_ line: CTLine, _ justificationFactor: CGFloat, _ justificationWidth: Double) -> CTLine?

Parameters

line

The line from which to create a justified line.

justificationFactor

Full or partial justification. When set to 1.0 or greater, full justification is performed. If this parameter is set to less than 1.0, varying degrees of partial justification are performed. If it is set to 0 or less, no justification is performed.

justificationWidth

The width to which the resultant line is justified. If justificationWidth is less than the actual width of the line, then negative justification is performed (that is, glyphs are squeezed together).

Return Value

A reference to a justified CTLine object if the call was successful; otherwise, NULL.

See Also

Creating Lines

func CTLineCreateWithAttributedString(CFAttributedString) -> CTLine

Creates a single immutable line object directly from an attributed string.