티스토리 뷰
간단한 예제...
출처 : http://wizard.ncafe.net/wt/2269
참고
<?php
/***************************************************************
프로그램명 : Text를 GD 이미지로 뿌리기
작성자 : 윤영식
***************************************************************/
if (!$fontsize) { $fontsize=11; }
Header ("Content-type: image/png");
$bound = ImageTTFBBox($fontsize,0,"fonts/HMTGR.TTF",stripslashes(iconv("EUC-KR","UTF-8",$_GET[text])));
$imgWidth = $bound[2]+2;
$imgHeight = $fontsize*1.2;
$im=ImageCreate($imgWidth,$imgHeight);
$white = ImageColorAllocate ($im, 255, 255, 255);
$green = ImageColorAllocate ($im, 88, 88, 88);
ImageTTFText($im,$fontsize,0,0,$imgHeight-1,$green,"fonts/HMTGR.TTF",stripslashes(iconv("EUC-KR","UTF-8",$_GET[text])));
ImagePNG($im);
ImageDestroy($im);
?>
/***************************************************************
프로그램명 : Text를 GD 이미지로 뿌리기
작성자 : 윤영식
***************************************************************/
if (!$fontsize) { $fontsize=11; }
Header ("Content-type: image/png");
$bound = ImageTTFBBox($fontsize,0,"fonts/HMTGR.TTF",stripslashes(iconv("EUC-KR","UTF-8",$_GET[text])));
$imgWidth = $bound[2]+2;
$imgHeight = $fontsize*1.2;
$im=ImageCreate($imgWidth,$imgHeight);
$white = ImageColorAllocate ($im, 255, 255, 255);
$green = ImageColorAllocate ($im, 88, 88, 88);
ImageTTFText($im,$fontsize,0,0,$imgHeight-1,$green,"fonts/HMTGR.TTF",stripslashes(iconv("EUC-KR","UTF-8",$_GET[text])));
ImagePNG($im);
ImageDestroy($im);
?>
출처 : http://wizard.ncafe.net/wt/2269
참고
위 소스 그대로 카피해서 imgtext.php 라고 서버에 만드세요. 그다음에 HMTGR.TTF 나.. 원하는 폰트를 서버 fonts/ 디렉토리에 업로드 하세요. windows/fonts 에 가면 폰트 있읍니다. 뭐 그 폰트가 다 되는것은 아닙니다.
그다음에 제로보드에서 제목 뿌려주는 부분에 <img src="imgtext.php?text=제목> 이렇게 고치시면됩니다. 제목은 urlencode() 함수를 써서 encoding 해주면 되고요.
그다음에 제로보드에서 제목 뿌려주는 부분에 <img src="imgtext.php?text=제목> 이렇게 고치시면됩니다. 제목은 urlencode() 함수를 써서 encoding 해주면 되고요.
댓글
공지사항
- Total
- 210,854
- Today
- 0
- Yesterday
- 2
링크
TAG
- 쿠폰생성
- 가상디렉터리
- WiFi
- MySQL
- 티스토리달력2010
- 등밀이기계
- 파이어폭스
- 아파치
- mqueue
- Apache
- root권한
- Xpenology
- vi
- cpulimit
- win2008R2
- UTF8
- 리눅스
- 와이파이암호
- 터미널 서비스
- mysqldump
- SCANPST.EXE
- 데이터 파일 오류
- iconcache.db
- ssl비밀번호
- win2008
- 부가기능 오류
- 프린트먹통
- tar
- php
- 아이콘깨짐