PHP不加载ttf
此脚本可在本地主机(Windows)上运行,但不能在服务器(Debian)上运行: 我以1:1的比例上传了这些文件。请帮帮我,谢谢:)PHP不加载ttf,php,fonts,imagettftext,Php,Fonts,Imagettftext,此脚本可在本地主机(Windows)上运行,但不能在服务器(Debian)上运行: 我以1:1的比例上传了这些文件。请帮帮我,谢谢:) Windows不区分大小写,而Debian不区分大小写。我会检查ttf文件名大小写是否与您的代码匹配。文件名是否真的有一个大写的Bnext到正确的名称:文件可读吗?是否正确指定了文件的路径? <?php function red_rectangle($img_src,$x1,$y1,$x2,$y2,$tr, $user) { // Load image $
Windows不区分大小写,而Debian不区分大小写。我会检查ttf文件名大小写是否与您的代码匹配。文件名是否真的有一个大写的Bnext到正确的名称:文件可读吗?是否正确指定了文件的路径?
<?php
function red_rectangle($img_src,$x1,$y1,$x2,$y2,$tr, $user)
{
// Load image
$img = imagecreatefrompng($img_src);
// Transparent red
$red = imagecolorallocatealpha($img, 0, 0, 0, $tr);
// Draw a white rectangle
imagefilledrectangle($img, $x1, $y1, $x2, $y2, $red);
$white = ImageColorAllocate ($img, 255, 255, 255);
ImageTTFText ($img, 35, 0, 15, 350, $white, "Big.ttf",
$user);
// Don't forget to output a correct header
header('Content-Type: image/jpg');
// Save the image (overwrite)
imagepng($img);
imagedestroy($img);
}
$img_src = 'playerimages/streamnew.png';
$box = imagettfbbox ( 35 , 0 , "Big.ttf" , $_GET['username'] );
$width = abs($box[4] - $box[0]);
$height = abs($box[5] - $box[1]);
$x1= 10;
$y1= 310;
$x2 = 25+$width;
$y2=360;
red_rectangle($img_src,$x1,$y1,$x2,$y2,50, $_GET['username']);
?>