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

imagepsloadfont

(PHP 4, PHP 5)

imagepsloadfont - 从文件加载PostScript Type 1字体

警告

该功能在PHP 7.0.0中已被删除

描述

代码语言:javascript
复制
resource imagepsloadfont ( string $filename )

从给定的文件中加载PostScript Type 1字体filename

参数

filename

Postscript字体文件的路径。

返回值

在一切正常的情况下,将返回一个有效的字体索引,并可用于进一步的目的。否则函数返回FALSE

例子

Example #1 imagepsloadfont() example

代码语言:javascript
复制
<?php
// Create a new image instance
$im = imagecreatetruecolor(350, 45);

// Allocate colors and fill the background
$black = imagecolorallocate($im, 0, 0, 0);
$white = imagecolorallocate($im, 255, 255, 255);
imagefilledrectangle($im, 0, 0, 349, 44, $white);

// Load a font, write to the image and free the font from memory
$font = imagepsloadfont("bchbi.pfb");
imagepstext($im, "Testing... It worked!", $font, 32, $white, $black, 32, 32);
imagepsfreefont($font);

// Output the image
header('Content-type: image/png');

imagepng($im);
imagedestroy($im);
?>

更新日志

描述

7.0.0

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

注释

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

← imagepsfreefont

imagepsslantfont →

扫码关注腾讯云开发者

领取腾讯云代金券