【发布时间】:2012-08-17 03:05:16
【问题描述】:
我正在使用imagettftext() 在图像上创建文本。我使用了 times new roman 字体,该应用程序在我的开发机器上运行良好,但在实际环境中却不行。
请告知。是不是因为我的开发者。 windows 和 live 中的机器是 linux 吗?
请帮忙
实际问题是我的 locahost 上的文本显示为“Monster”,但在实时服务器“Monster”上,这不仅是 O,而且还有其他字母......
$font = './fonts/times.ttf';
$bbox = imagettfbbox(30, 0, $font, $word);
$x = $bbox[0] + (imagesx($src) / 2) - ($bbox[4] / 2);
$y = $bbox[1] + (imagesy($src) / 2) - ($bbox[5] / 2)+212;
imagettftext($src, 30, 0, $x, $y, $color, $font, $word);
$bbox2 = imagettfbbox(18, 0, $font, $definition);
$x = $bbox2[0] + (imagesx($src) / 2) - ($bbox2[4] / 2);
$y = $bbox2[1] + (imagesy($src) / 2) - ($bbox2[5] / 2)+245;
imagettftext($src, 18, 0, $x, $y, $white, $font, $definition);
【问题讨论】:
-
apache 是否有权读取字体所在的文件/目录?