ContourBaseline

class ContourBaseline(val contour: ShapeContour, val offset: Double = 0.0, measureOnBaseline: Boolean = true, samplesPerSegment: Int = 64) : TextBaseline(source)

The baseline for text on a contour: the curve at distance offset from the contour, positive distances move the baseline towards the ascenders of the text. Distances along the baseline map to positions on the contour.

Parameters

measureOnBaseline

measure distances on the offset curve, so glyph spacing is correct on the offset curve, which is longer than the contour on the outside of a bend and shorter on the inside. When false distances are measured on the contour, like text on a path in SVG.

samplesPerSegment

the number of samples per segment used to measure the contour

Constructors

Link copied to clipboard
constructor(contour: ShapeContour, offset: Double = 0.0, measureOnBaseline: Boolean = true, samplesPerSegment: Int = 64)

Properties

Link copied to clipboard
open override val closed: Boolean

true when the baseline comes round to its start, so that text can wrap around it

Link copied to clipboard
val contour: ShapeContour
Link copied to clipboard
open override val length: Double

the length of the baseline

Link copied to clipboard

Functions

Link copied to clipboard
open override fun pose(distance: Double): Matrix44

The frame at distance along the baseline: the x-axis follows the contour, the y-axis points away from the ascenders, like the y-axis of the glyph positions of typesetText.

Link copied to clipboard
fun t(distance: Double): Double

the contour t of the point at distance along the baseline