layoutTextOnContour

fun layoutTextOnContour(spans: List<TextSpan>, baseline: TextBaseline, style: TextStyle = TextStyle.Defaults, startDistance: Double = 0.0, anchor: Double = 0.0, overflow: ContourOverflow = ContourOverflow.WRAP, pivot: GlyphPivot = GlyphPivot.START, shifts: List<Vector2> = emptyList(), shaper: TextShapingDriver = TextShapingDriver.instance): ContourTextLayout(source)

Places spans on a single line along baseline. The text is shaped as a single paragraph, so it is ordered and shaped across spans; newlines are treated as spaces. The size, width factor and baseline shift of the style of every span are applied, like typesetText does.

Every span can shift the text from its first character on, like the dx and dy attributes of SVG text: the x component of its shift moves the text along the baseline, the y component moves it across the baseline, away from the ascenders for positive values. Shifts accumulate, a shift applies to the text of its span and to all text that follows it. In mixed-direction text shifts are applied in visual order, at the word that holds the first character of the span.

Parameters

style

the style that is cascaded into the style of every span

startDistance

the distance along the baseline at which the text is anchored

anchor

the point of the text at startDistance, 0.0 for the start, 0.5 for the middle, 1.0 for the end

overflow

what happens to glyphs beyond the start or the end of the baseline

pivot

the point of every glyph that is placed on the baseline

shifts

the shift of every span, or an empty list