1 |
ravilov |
1.1 |
<?php |
2 |
|
|
if (!$text) exit; |
3 |
|
|
$map = array( |
4 |
|
|
"è" => 269, "è" => 269, |
5 |
|
|
"æ" => 263, "æ" => 263, |
6 |
|
|
"¹" => 353, "" => 353, |
7 |
|
|
"¾" => 382, "" => 382, |
8 |
|
|
"ð" => 273, "ð" => 273, |
9 |
|
|
"È" => 268, "È" => 268, |
10 |
|
|
"Æ" => 262, "Æ" => 262, |
11 |
|
|
"©" => 352, "" => 352, |
12 |
|
|
"®" => 381, "" => 381, |
13 |
|
|
"Ð" => 272, "Ð" => 272 |
14 |
|
|
); |
15 |
|
|
while (list($k, $v) = each($map)) $text = str_replace($k, "&#".$v.";", $text); |
16 |
|
|
$text = preg_replace("/\\\(.)/", '$1', $text); |
17 |
ravilov |
1.2 |
$im = ImageCreate(130, 18); |
18 |
ravilov |
1.1 |
$dark = ImageColorAllocate($im, 0x66, 0x99, 0x66); |
19 |
|
|
$mid = ImageColorAllocate($im, 0xB6, 0xE1, 0xCB); |
20 |
|
|
$light = ImageColorAllocate($im, 0xFF, 0xFF, 0xFF); |
21 |
|
|
ImageFill($im, 0, 0, $mid); |
22 |
|
|
ImageLine($im, 0, 0, ImageSX($im) - 1, 0, $light); |
23 |
|
|
ImageLine($im, 0, 0, 0, ImageSY($im) - 1, $light); |
24 |
|
|
ImageLine($im, ImageSX($im) - 1, 1, ImageSX($im) - 1, ImageSY($im) - 1, $dark); |
25 |
|
|
ImageLine($im, 0, ImageSY($im) - 1, ImageSX($im) - 1, ImageSY($im) - 1, $dark); |
26 |
|
|
$txt = ImageColorAllocate($im, 0x33, 0x66, 0x33); |
27 |
|
|
if ($type) { |
28 |
ravilov |
1.2 |
ImageTTFText($im, 8, 0, 4, 13, $light, "verdanab.ttf", $text); |
29 |
|
|
ImageTTFText($im, 8, 0, 3, 12, $dark, "verdanab.ttf", $text); |
30 |
|
|
} else ImageTTFText($im, 8, 0, 3, 12, $txt, "verdanab.ttf", $text); |
31 |
ravilov |
1.1 |
$types = ImageTypes(); |
32 |
|
|
if ($types & IMG_GIF) { |
33 |
|
|
Header("Content-Type: image/gif"); |
34 |
|
|
ImageGIF($im); |
35 |
|
|
} else if ($types & IMG_PNG) { |
36 |
|
|
Header("Content-Type: image/png"); |
37 |
|
|
ImagePNG($im); |
38 |
|
|
} else if ($types & IMG_JPG) { |
39 |
|
|
Header("Content-Type: image/jpeg"); |
40 |
|
|
ImageJPEG($im); |
41 |
|
|
} else if ($types & IMG_WBMP) { |
42 |
|
|
Header("Content-Type: image/vnd.wap.wbmp"); |
43 |
|
|
ImageWBMP($im); |
44 |
|
|
} |
45 |
|
|
ImageDestroy($im); |
46 |
|
|
?> |