류

GD를 이용해 TTF폰트를 브라우져에 이미지로 나타내기..

· 2006-02-05 (일) 07:18:19 · 1747 · 1
<?
  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);
?>
 
 
설명서 :  클릭
 
 
어디가 잘못된거죠?
스킨에 적용시킬려하는데..
엔지오라는 사이트에서 글거왔습니다.
혹시 아시는분 부탁드립니다. 감사합니다.
|

댓글 1개

다음 링크의 내용도 참고해보세요
http://www.sir.co.kr/bbs/board.php?bo_table=g3_tiptech&wr_id=2418
댓글을 작성하시려면 로그인이 필요합니다.

자유게시판

203,079건
+
제목 글쓴이 날짜 조회
06-02-05 조회 1,716
06-02-05 조회 1,779
06-02-05 조회 1,704
06-02-05 조회 1,837
06-02-05 조회 1,464
슈슈가쭌
06-02-05 조회 1,466
06-02-05 조회 2,140
06-02-05 조회 1,748
러러브레터
06-02-05 조회 1,663
06-02-05 조회 1,335
06-02-04 조회 1,827
06-02-04 조회 1,509
06-02-04 조회 4,973
06-02-04 조회 1,552
06-02-04 조회 1,353
06-02-04 조회 1,442
06-02-04 조회 1,934
06-02-04 조회 1,427
06-02-04 조회 1,395
러러브레터
06-02-04 조회 1,340