place

fun place(polyline: List<Vec2>, text: String, charWidths: FloatArray, textWidth: Float, repeatGapPx: Float = 250.0f): List<MvtCurvedTextPlacer.GlyphRun>

Lay out text along polyline using one GlyphRun per repeat. Returns empty when the polyline is too short to fit a single full repeat (length < textWidth).

Parameters

polyline

Screen-space waypoints (typically projected from geographic via rc.project(...)). Z is ignored; we treat the curve as 2D in screen. At least 2 points required, otherwise returns empty list.

charWidths

Per-character advance widths in pixels, parallel to text.

textWidth

Total width of text in pixels (sum of charWidths). Passed separately to avoid recomputation by callers that already have it.

repeatGapPx

Gap between the end of one label's last glyph and the start of the next repeat's first glyph. Mapbox's symbol-spacing default is 250 px.