I have a font in ttf file and want to generate SVG with text turned into paths. I don\'t need image (so using imagettftext or Image Magick font rendering capabilities is not
I just wrote a PHP library based on yours that manipulates font data (from SVG file) and does any sort of transformation on it. You may give it a try from the GitHub :
https://github.com/kartsims/easysvg
Usage example :
require 'easySVG.php';
$svg = new EasySVG();
$svg->setFont("paris-bold-webfont.svg", 100, "#000000");
$svg->addText("Simple text display");
$svg->addAttribute("width", "800px");
$svg->addAttribute("height", "100px");
echo $svg->asXML();
SVG data manipulation example :
$def = 'YOUR SVG DEFINITION HERE';
$easySVG = new EasySVG();
// rotate by 40°
$rotated_def = $easySVG->defRotate($def, 40)
// rotate by 40° with center at (200,100)
$rotated_def2 = $easySVG->defRotate($def, 40, 200, 100)
// scale transform : width*4
$scaled_def = $easySVG->defScale($def, 4)