Taos API Reference
    Preparing search index...

    Function placeGlyphsAlongLine

    • Places a line of glyphs along a road polyline. Each glyph is sampled at its center's arc length, oriented to the local tangent. The text is centered on the polyline and, if the run would read right-to-left overall (tangent pointing left), the whole polyline is reversed first so labels stay upright. Returns null when the road is shorter than the text (caller skips it).

      centers are each glyph's center position measured from the text start (so word spaces are baked in by the caller); width is the text's full advance. Curvature isn't rejected here — the caller can pre-split very kinked roads if desired.

      Parameters

      • points: readonly (readonly [number, number])[]
      • centers: number[]
      • width: number

      Returns PlacedGlyph[] | null