GD를 이용해 TTF폰트를 브라우져에 이미지로 나타내기.. 정보
도움요청 GD를 이용해 TTF폰트를 브라우져에 이미지로 나타내기..본문
<?
Header("Content-type: image/gif");
if(!isset($s)) $s=11;
$size = imagettfbbox($s,0,"/fonts/폰트명",$text);
$dx = abs($size[2]-$size[0]);
$dy = abs($size[5]-$size[3]);
$xpad=9;
$ypad=9;
$im = imagecreate($dx+$xpad,$dy+$ypad);
$blue = ImageColorAllocate($im, 0x2c,0x6D,0xAF);
$black = ImageColorAllocate($im, 0,0,0);
$white = ImageColorAllocate($im, 255,255,255);
ImageRectangle($im,0,0,$dx+$xpad-1,$dy+$ypad-1,$black);
ImageRectangle($im,0,0,$dx+$xpad,$dy+$ypad,$white);
ImageTTFText($im, $s, 0, (int)($xpad/2)+1, $dy+(int)($ypad/2), $black, "/fonts/폰트명", $text);
ImageTTFText($im, $s, 0, (int)($xpad/2), $dy+(int)($ypad/2)-1, $white, "/fonts/폰트명", $text);
ImageGif($im);
ImageDestroy($im);
?>
Header("Content-type: image/gif");
if(!isset($s)) $s=11;
$size = imagettfbbox($s,0,"/fonts/폰트명",$text);
$dx = abs($size[2]-$size[0]);
$dy = abs($size[5]-$size[3]);
$xpad=9;
$ypad=9;
$im = imagecreate($dx+$xpad,$dy+$ypad);
$blue = ImageColorAllocate($im, 0x2c,0x6D,0xAF);
$black = ImageColorAllocate($im, 0,0,0);
$white = ImageColorAllocate($im, 255,255,255);
ImageRectangle($im,0,0,$dx+$xpad-1,$dy+$ypad-1,$black);
ImageRectangle($im,0,0,$dx+$xpad,$dy+$ypad,$white);
ImageTTFText($im, $s, 0, (int)($xpad/2)+1, $dy+(int)($ypad/2), $black, "/fonts/폰트명", $text);
ImageTTFText($im, $s, 0, (int)($xpad/2), $dy+(int)($ypad/2)-1, $white, "/fonts/폰트명", $text);
ImageGif($im);
ImageDestroy($im);
?>
설명서 : 클릭
어디가 잘못된거죠?
스킨에 적용시킬려하는데..
엔지오라는 사이트에서 글거왔습니다.
혹시 아시는분 부탁드립니다. 감사합니다.
추천
0
0
댓글 1개
다음 링크의 내용도 참고해보세요
http://www.sir.co.kr/bbs/board.php?bo_table=g3_tiptech&wr_id=2418
http://www.sir.co.kr/bbs/board.php?bo_table=g3_tiptech&wr_id=2418