Skip to content

Instantly share code, notes, and snippets.

@sunsgs
Created March 2, 2017 10:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sunsgs/2bd4206648030d7fdd1d7a2ca1caa183 to your computer and use it in GitHub Desktop.
Save sunsgs/2bd4206648030d7fdd1d7a2ca1caa183 to your computer and use it in GitHub Desktop.
<?php
$text = "text text";
$svg = new EasySVG();
$svg->setFontSVG("om_telolet_om-webfont.svg");
$svg->setFontSize(80);
$svg->setFontColor('#000000');
$svg->setLineHeight(1.2);
$svg->setLetterSpacing(.1);
$svg->addAttribute("width", "600px");
$svg->addAttribute("height", "400px");
$svg->addText($text,"center","center");
// set width/height according to text
list($textWidth, $textHeight) = $svg->textDimensions($text);
echo $svg->asXML();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment