Convert to Path Textfields in SVG file
npm install --save svg-text-path
const svgToPath = require('svg-text-path');
- Load and save paths of the svg file
var options={
source:'./public/convert/svg.svg',
destination:'./public/convert/svg-convert.svg'
}
- Generates convert to path svg and saves to destination path
const convertFile=await svgToPath.conversion(options);
Add Fonts
- Open svg-text-path/config/fonts.json file
{'font': [{
'Times New Roman': {
'dest': './public/fonts/times.ttf'
}
}]}
- Simply add more fonts to json
'My New Font Name': {
'dest': 'My New Font Path'
}
{'font': [{
'Times New Roman': {
'dest': './public/fonts/times.ttf'
},
'My New Font Name': {
'dest': 'My New Font Path'
}
}]}