Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/243.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP不加载ttf_Php_Fonts_Imagettftext - Fatal编程技术网

PHP不加载ttf

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)上运行:

我以1:1的比例上传了这些文件。请帮帮我,谢谢:)


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']);
?>