21,886
社区成员
发帖
与我相关
我的任务
分享
$fnt = 'c:/windows/fonts/webdings.ttf';
//$fnt = 'c:/windows/fonts/wingding.ttf';
//$fnt = 'c:/windows/fonts/wingdng2.ttf';
//$fnt = 'c:/windows/fonts/wingdng3.ttf';
$im = imagecreatetruecolor(500, 250);
imagefill($im, 0, 0, imagecolorallocate($im, 255, 255, 200));
$c = imagecolorallocate($im, 0, 0, 0);
$n = 32;
$k = 30;
for($y=0; $y<8; $y++) {
for($x=0; $x<16; $x++) {
$s = chr(0xf0) . chr($n++);
$s = iconv('ucs-2', 'utf-8', $s);
imagettftext($im, 20, 0, $x * $k, $y * $k + $k, $c, $fnt, $s);
}
}
for($i=32;$i<128;$i++) {
printf("<font face='webdings' size='20'>%c</font>", $i);
}