<?
function Offtopic2utf($str)
{
$utf = "";
for($i = 0; $i < strlen($str); $i++)
{
$donotrecode = false;
$c = ord(substr($str, $i, 1));
if ($c == 0xA8) $res = 0xD081;
elseif ($c == 0xB8) $res = 0xD191;
elseif ($c < 0xC0) $donotrecode = true;
elseif ($c < 0xF0) $res = $c + 0xCFD0;
else $res = $c + 0xD090;
$utf .= ($donotrecode) ? chr($c) : (chr($res >> 8) . chr($res & 0xff));
}
return $utf;
}
header ("Content-type: image/gif");
$im = imagecreatefrompng ("./1.png") or die ("Cannot Initialize new GD image stream");
$text_color = imagecolorallocate ($im, 0, 0, 100);
imagettftext ( $im, 10, 0, 25, 35, $text_color, "C:/WINDOWS/Fonts/tahoma.ttf", Offtopic2utf("Проверка!!!"));
imagejpeg ($im);
?>