"; 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= " "; $intext=$_POST['story']; $intext=str_replace("."," . ",$intext); $intext=str_replace("\n"," [new] ",$intext); $intext=str_replace("\r","",$intext); $intext=str_replace("\""," \" ",$intext); $intext=str_replace("\\"," \\ ",$intext); $intext=str_replace(","," , ",$intext); $intext=str_replace("!"," ! ",$intext); $intext=str_replace("?"," ? ",$intext); $intext=str_replace(":"," : ",$intext); $intext=str_replace(";"," ; ",$intext); $intext=str_replace("-"," - ",$intext); $intext=strtolower($intext); $stext=split(" ",$intext); for($i=0;$i"; $thisw=trim($stext[$i]); if($thisw=="[new]"){ $voff=0; $hoff+=200; } $filed.= draw_glyph($hoff,$voff,$thisw); if(strlen($thisw)>0)$voff+=5; } //$filed.= draw_glyph(1,$voff,"fox"); //$filed.= draw_glyph(1,$voff,"and"); //$filed.= draw_glyph(1,$voff,"the"); $filed.=""; echo $filed; $myFile = "testFile.svg"; $fh = fopen($myFile, 'w') or die("can't open file"); fwrite($fh, $filed); fclose($fh);