首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

imagepsencodefont

(PHP 4, PHP 5)

imagepsencodefont - 更改字体的字符编码矢量

警告

该功能在PHP 7.0.0中已被删除

描述

代码语言:javascript
复制
bool imagepsencodefont ( resource $font_index , string $encodingfile )

从文件加载字符编码矢量并将字体编码矢量更改为它。由于PostScript字体默认向量缺少127以上的大部分字符位置,因此如果使用英语以外的其他语言,则一定要更改此设置。

如果您始终发现自己使用此函数,定义编码的更好方法是在配置文件中设置ps.default_encoding 以指向正确的编码文件,并且您加载的所有字体都将自动具有正确的编码。

参数

font_index

由imagepsloadfont()返回的字体资源。

encodingfile

这个文件的确切格式在T1libs文档中有描述。T1lib带有两个随时可用的文件,IsoLatin1.enc和IsoLatin2.enc。

返回值

返回TRUE成功或失败时返回FALSE

例子

Example #1 imagepsencodefont() example

代码语言:javascript
复制
<?php
// Load a .pfb font file
$font = imagepsloadfont('./px3l.pfb');

// Tell T1lib to use ISO Latin 1 encoding
imagepsencode($font, './IsoLatin1.enc');

// Do any operations with the font here

// Free the font from memory
imagepsfreefont($font);
?>

更新日志

描述

7.0.0

T1Lib支持已从PHP中删除,因此此功能已被删除。

注释

注意:只有在使用--with-t1lib = DIR编译PHP时才能使用此函数。

← imagepsbbox

imagepsextendfont →

扫码关注腾讯云开发者

领取腾讯云代金券