error_reporting(E_ALL);
$voff=0;
$hoff=0;
$vmax=5000;
function draw_glyph($x,$y,$text){
global $voff,$vmax,$hoff;
$fn="/var/www/vec/vec/".substr($text,0,1)."/".substr($text,1,1)."/".$text.".svg";
if(!file_exists($fn)){
echo "No file $text
";
return;
}
$fd=file($fn);
$fdt=implode($fd);
$fd[0]="";
$tsplit=split("height=\"",$fdt);
$tsplit=split("\"",$tsplit[1]);
$voff+=$tsplit[0];
//echo "($voff+=".$tsplit[0].")";
if($voff>$vmax){
$voff=$tsplit[0];
$y=0;
$hoff+=120;
$x=$hoff;
}
$fd[1]=" ";
$fd=implode($fd)."";
//echo "[".$voff."]";
//echo $fd.$fn;
return $fd;
}
//header("Content-type: image/svg+xml");
$filed= "
";
echo $filed;
$myFile = "testFile.svg";
$fh = fopen($myFile, 'w') or die("can't open file");
fwrite($fh, $filed);
fclose($fh);