Details
-
Task
-
Resolution: Unresolved
-
P2: Important
-
None
-
None
-
None
Description
Many formats for vector graphics contain the possibility to draw text along a line, e.g.:
- SVG 1.1: "textPath": In addition to text drawn in a straight line, SVG also includes the ability to place text along the shape of a ‘path’ element. https://www.w3.org/TR/SVG11/text.html#TextPathElement
- MapBox "symbol-placement": The label is placed along the line of the geometry. Can only be used on LineString and Polygon geometries. https://docs.mapbox.com/style-spec/reference/layers/#layout-symbol-symbol-placement
QtQuick lacks an API to draw such text in a simple and efficient way. It would be great to have an additional QSGCurvedTextNode that takes a QTextLayout along a QPainterPath to draw the layouted text along a curved line.
It should also consider the options form SVG, at least ‘startOffset’ and offset ‘method’, and the options form MapBox, at least 'text-anchor'.
Breaking lines can probably be ignored.