PHP  
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  
<imagelineimagepalettecopy>
Last updated: Mon, 16 Jul 2012

imageloadfont

(PHP 3, PHP 4, PHP 5)

imageloadfont -- 载入一新字体

说明

int imageloadfont ( string file )

imageloadfont() 加载一个用户定义的位图字体并返回该字体的标识符(其值总是大于 5,因此不会和内置字体冲突)。

字体文件格式目前是二进制的且和平台有关。这意味着应该用和你运行 PHP 的机器相同类型 CPU 的机器生成字体。

表格 1. 字体文件格式

字节位置C 数据类型说明
byte 0-3int字体中的字符数目
byte 4-7int字体中第一个字符的值(通常是 32 代表空格)
byte 8-11int每个字符宽度的像素值
byte 12-15int每个字符高度的像素值
byte 16-char 字符数据的数组,每字符中每像素一字节,一共 (nchars*width*height) 字节。

参见 imagefontwidth()imagefontheight()




<imagelineimagepalettecopy>
 Last updated: Mon, 16 Jul 2012
 
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://manual.phpv.net/
Last updated: Thu Jul 7 19:13:47 2005 CST