Creates a pattern containing text.
This is demonstrated in the following sample code:
const textPattern = text({text: ["Read me"], textStyle: { font: "Arial, sans-serif", fill: "rgb(0, 0, 0)"}}); const complexStrokedLineStyle = { decorations: [{ location: 0.5, pattern: textPattern }], fallback: parallelLine() }; Copy
const textPattern = text({text: ["Read me"], textStyle: { font: "Arial, sans-serif", fill: "rgb(0, 0, 0)"}}); const complexStrokedLineStyle = { decorations: [{ location: 0.5, pattern: textPattern }], fallback: parallelLine() };
Results in:
Note that the following TextStyle properties, affecting the position of the text, are ignored:
To offset text vertically, use offset. To offset text horizontally, use append to insert a pattern before the text pattern.
offset
An object literal describing the configuration of the pattern.
Creates a pattern containing text.
This is demonstrated in the following sample code:
Results in:
Note that the following TextStyle properties, affecting the position of the text, are ignored:
To offset text vertically, use
offset. To offset text horizontally, use append to insert a pattern before the text pattern.