$mr=imagettfbbox (6,0, $font, $cur); $pr=$mr[2]; $ds=strlen($cur); while ($pr >= $raz) { $cur1=substr($cur,0,$ds); $mr=imagettfbbox (6,0, $font, $cur1); $pr=$mr[2]; $ds=$ds-1; } if ($ds!=strlen($cur)) {$cur=$cur1."...";} imagettftext ($im, 6, 0, $x, $y, $color, $font, $cur);
imagettftext ($im, 6, 0, $x, $y, $color, $font, $cur);
<?php header ("Content-type: image/png"); $im = ImageCreateFromPng("blank.png"); $color = imagecolorallocate ($im, 255, 255, 255); $file_name='http://wasteland.spb.su:8080/status2.xsl'; $r=fopen($file_name,'r'); $text=fread($r,1000); fclose($r); $mass=explode(",", $text); $current="track".$mass [16]; imagettftext ($im, 6, 0, 15, 20, $color, "ft.ttf",$current); imagepng ($im); imagedestroy ($im); ?>
<?php header ("Content-type: image/png"); $im = ImageCreateFromPng("blank.png"); $color = imagecolorallocate ($im, 255, 255, 255); $file_name='http://wasteland.spb.su:8080/status2.xsl'; $r=fopen($file_name,'r'); $text=fread($r,1000); fclose($r); $mass=explode(",", $text); $current="track".$mass [16]; $mr=imagettfbbox (6,0, $font, $file_name); $pr=$mr[2]; $ds=strlen($file_name); while ($pr >= $raz) { $cur1=substr($cur,0,$ds); $mr=imagettfbbox (6,0, $font, $cur1); $pr=$mr[2]; $ds=$ds-1; } if ($ds!=strlen($file_name)) {$file_name=$cur1."...";} imagettftext ($im, 6, 0, $x, $y, $color, $font, $cur); imagettftext ($im, 6, 0, 15, 20, $color, "ft.ttf",$current); imagepng ($im); imagedestroy ($im); ?>