PHP GD库应用——描边字

Posted by Hpyer on 2008-11-02, 星期天
Tagged with: , ,

效果:

示例/源码:
http://demo.hpyer.cn/php/gd/#clear_fonts

说明:

void clear_fonts(resource image, int size, int x, int y, string color, string fontfile, string text, string outercolor);

clear_fonts() 将字符串 text 画到 image 所代表的图像上,从坐标 x,y(左上角为 0, 0)开始,颜色为 color,边框所使用的颜色为 outercolor,使用 fontfile 所指定的 TrueType 字体文件。如果不指定字体文件,则使用GD的内部字体。根据 PHP 所使用的 GD 库的不同,如果 fontfile 没有以“/”开头,则“.ttf”将被加到文件名之后并且会搜索库定义字体路径。

注:如果指定了字体文件,由 x,y 所表示的坐标定义了第一个字符的基本点(大概是字符的左下角)。否则 x,y 定义了第一个字符的右上角。

fontfile 是想要使用的 TrueType 字体的文件名。
text 是文本字符串,支持 UTF-8 字符。
color 是十六进制的 #RRGGBB 格式的颜色,如:#FF0000 表示红色。
outercolor 描边颜色,十六进制的#RRGGBB格式。

相关日志

Did you enjoy this article? Share it or give it a bump!
1,666 Views

Write a Comment

Gravatars are small images that can show your personality. You can get your gravatar for free today!

Welcome to Hpyer 的未知空间

  哈咯~很高兴您能在浩瀚的网络中找到本站,虽然本站只是个博客,但是它却不仅仅是一个博客。在这里你将会了解到一些网页制作方面的知识,同时也可以获得一些实用的程序源码。但愿您在这次短暂的访问中可以有所收获。【了解更多】 【联系 Hpyer

Search

Search posts by Google engine. FROM:    

Advertisement