$image_width) { $image_width = $temp_len; } } $image_width = $image_width * $fontx; // Sanity Checks if ($image_width > 1600) { $image_width = 1600; } $im = imagecreatetruecolor($image_width, $image_height); $bgc = imagecolorallocate($im, $red, $green, $blue); imagefill($im, 0, 0, $bgc); for ($c = 0; $c < count($nfo); $c++) { $x = $fontx; $line = $nfo[$c]; for ($i = 0; $i < strlen($line); $i++) { $current_char = substr($line, $i, 1); if ($current_char !== "\r" && $current_char !== "\n") { $offset = ord($current_char) * 5; imagecopy($im, $fontset, $x, $y, $offset, $colour, $fontx, $fonty); $x += $fontx; } } $y += $fonty; } header("Content-type: image/png"); imagepng($im); imagedestroy($im); ?>