1
私は、画像の上にテキストを追加しよう:するimagestringゴミのテキスト問題
すでに試した$newImg = imagecreatetruecolor($dst_width, $dst_height);
imagealphablending($newImg, false);
imagecopyresampled($newImg, $im, 0, 0, 0, 0, $dst_width, $dst_height, $width, $height);
imagesavealpha($newImg, true);
if(!empty($name)){
$fontSrc = './fonts/DejaVuSans.ttf';//support utf8 and unicode
$font = imageloadfont($fontSrc);
//Couleur des noms
$bg = imagecolorallocatealpha($newImg, 0, 0, 0, 0);
$textcolor = imagecolorallocatealpha($newImg, 255, 255, 255, 1);
//Deplacer les noms
imagestring($newImg, $font, 0, $dst_height - 17, 'שדגשדג', $textcolor);
}
:
header('Content-Type: text/html; charset=utf-8');
imagestring($newImg, 500, 0, $dst_height - 17, utf8_encode('שדגשדגש'), $textcolor);
私はヘブライ語(UTF8)にテキストを入れたときに問題がある:שדגשד
そのテキストを表示しますあなたはその種類を見ることができるように
:そのような絵にゴミ箱のテキスト、それを修正する適切な方法は何ですか?
私の最初の推測は、使用されているフォントがユニコードをサポートしていないことです。 – Eiko
もそれを試しました、私は今編集します。 – Roasls