Is there a D3.js way to convert a text element into a path element?
So when I grasp the generated svg, I could keep my the texts shapes.
There is a node module called text-to-svg that claimed to do so:
Convert text to SVG path without native dependencies.
const TextToSVG = require('text-to-svg');
const textToSVG = TextToSVG.loadSync();
const attributes = {fill: 'red', stroke: 'black'};
const options = {x: 0, y: 0, fontSize: 72, anchor: 'top', attributes: attributes};
const svg = textToSVG.getSVG('hello', options);
console.log(svg);