[PHP] 이미지파일에 텍스트 넣기 (라이브러리)
사용자가 입력한 텍스트를
배경 이미지에 합성하는걸 찾다가 발견한 라이브러리!
가운데 정렬도 가능하고
줄 넘기는것도 가능하며
폰트를 각각 주는것과
색깔도 변경해주는~ 아주아주 유용한 녀석이다
소스파일은   imageAddText.zip
imageAddText.zip
사이트에서 다운 받을 수 있다.
테스트로 작성한 소스코드
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | <?php     include "./api/textBox/Box.php";     include "./api/textBox/Color.php";     use GDText\Box;     use GDText\Color;     $im = imagecreatetruecolor(500, 500);     $backgroundColor = imagecolorallocate($im, 0, 18, 64);     imagefill($im, 0, 0, $backgroundColor);     $box = new Box($im);     $box->setFontFace('./asset/font/BlueNorthInlineGrunge.ttf');     $box->setFontColor(new Color(255, 75, 140));     $box->setTextShadow(new Color(0, 0, 0, 50), 2, 2);     $box->setFontSize(40);     $box->setBox(20, 20, 460, 460);     $box->setTextAlign('left', 'top');     $box->draw("Franchise\nBold");     $box = new Box($im);     $box->setFontFace('./asset/font/Rainbow Bridge Personal Use.ttf');      $box->setFontSize(80);     $box->setFontColor(new Color(255, 255, 255));     $box->setTextShadow(new Color(0, 0, 0, 50), 0, -2);     $box->setBox(20, 20, 460, 460);     $box->setTextAlign('center', 'center');     $box->draw("Pacifico");     $box = new Box($im);     $box->setFontFace('./asset/font/South Gardens Personal Use.ttf');      $box->setFontSize(70);     $box->setFontColor(new Color(148, 212, 1));     $box->setTextShadow(new Color(0, 0, 0, 50), 0, -2);     $box->setBox(20, 20, 460, 460);     $box->setTextAlign('right', 'bottom');     $box->draw("Prisma");     header("Content-type: image/png");     imagepng($im); ?> | cs | 



