• Font
  • Family
  • Foundry
  • Designer
  • Sample
  • Article
  • Help
Fontke.com>Article>Details

网页字体应用,让你的网站再不只是默认字体-PHP

Date:2011-10-10 08:09:00| Application|Browse: 318|Source: 站酷网|Author: jeiry
  • Follow FontKe on Wechat to get Zcode
  • Scan the Qrcode to participate in the SVIP lottery
Introduction 上代码 <?$im = imagecreatefromjpeg($_GET[bg]); $font_color = ImageColorAllocate ($im, $_GET[r], $_GET[b], $_GET[g]); //这是文字颜色

上代码

$im = imagecreatefromjpeg($_GET[bg]);

$font_color = ImageColorAllocate ($im, $_GET[r], $_GET[b], $_GET[g]); //这是文字颜色,绿色

$text = $_GET[t]; //文字内容

$font_file = "./msyh.ttf"; //字体的linux绝对路径

imagettftext($im, $_GET[z],0, $_GET[x], $_GET[y], $font_color ,$font_file, $text); // 往图片插入文字

// output image

header("content-type: image/png");

//以png输出,

imagepng ($im);

imagedestroy($im);

?>

0
  • Follow FontKe on Wechat to get Zcode
  • Scan the Qrcode to participate in the SVIP lottery
网页字体应用,让你的网站再不只是默认字体-PHP Comments
Guest Please obey the rules of this website. Unclear?
网页字体应用,让你的网站再不只是默认字体-PHP Latest comments
No relevant comments