اردوکےفونٹکےمسائل
میرےویبپیچکےفونٹ,براوزرکیوجہسےبدلجاتےےیں,میںاپنےصفحےکوامیج بناکربراوزرکودیناچایتاہوں。
我尝试了很多教程/示例和搜索。我找不到解决方案。
一个很大的麻烦,我在图像创建中解决了使用Windows Share-Point来保存我的.php文件。我保存的所有文件都有UTF BOM。
当我使用UTF-8编码的简单记事本保存同一个文件时,PHP中的图像创建开始了。
我在URDU(南亚十亿语言)中有一句话,比如一个字符串 - 用UTF-8保存,完美地保存在数据库中,并在网络浏览器上显示。
与英语不同,乌尔都语字母加入制作单词,加入时,它们的表面形状是裁剪的 - 大小或样式。
我正在处理此代码
<?php
function watermarkImage ($SourceFile, $WaterMarkText, $DestinationFile) {
//$SourceFile is source of the image file to be watermarked
//$WaterMarkText is the text of the watermark
//$DestinationFile is the destination location where the watermarked images will be placed
//Delete if destinaton file already exists
@unlink($DestinationFile);
//This is the vertical center of the image
$top = getimagesize($SourceFile);
$top = $top[1]/2;
list($width, $height) = getimagesize($SourceFile);
$image_p = imagecreatetruecolor($width, $height);
$image = imagecreatefromjpeg($SourceFile);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width, $height);
//Path to the font file on the server. Do not miss to upload the font file
$font = 'arial.ttf';
//Font sie
$font_size = 36;
//Give a white shadow
$white = imagecolorallocate($image_p, 255, 255, 155);
imagettftext($image_p, $font_size, 0, 10, $top, $white, $font, $WaterMarkText);
//Print in black color
$black = imagecolorallocate($image_p, 0, 0, 0);
imagettftext($image_p, $font_size, 0, 8, $top-1, $black, $font, $WaterMarkText);
if ($DestinationFile<>'') {
imagejpeg ($image_p, $DestinationFile, 100);
} else {
header('Content-Type: image/jpeg');
imagejpeg($image_p, null, 100);
};
imagedestroy($image);
imagedestroy($image_p);
};
?>
<?php
/*
// The text to draw
require('../../../I18N/Arabic.php'); // It converts the left side language to right side
$Arabic = new I18N_Arabic('Glyphs'); //
$font = './DroidNaskh-Bold.ttf';
$text = "جب درخشاں ہوں ستاروں کے چراغ";
$text = $Arabic->utf8Glyphs('جب درخشاں ہوں ستاروں کے چراغ ');
It gave me ﻍﺍﺭچ ےک ںﻭﺭﺎﺘﺳںﻭہ ںﺎﺸﺧﺭﺩ ﺐﺟ , reversing the string ,
*/
$text = "ﻍﺍﺭچ ےک ںﻭﺭﺎﺘﺳںﻭہ ںﺎﺸﺧﺭﺩ ﺐﺟ"; // Problem in joining of Urdu -
// Text
// Sequence of characters reversed in string using utf8Glyphs( ) ;
$SourceFile = 'nature (28).jpg';//Source image
$DestinationFile = 'watermarked/sky.jpg';//Destination path
//Call the function to watermark the image
watermarkImage ($SourceFile, $text, $DestinationFile);
//Display watermarked image if desired
if(file_exists($DestinationFile)){
echo "<img src=\"watermarked/sky.jpg\">";
echo "<p>The image has been watermarked at '".$DestinationFile."'</p>";
}
?>
我在FLY上为其他UTF-8创建的图像工作正常。
亲切的问候。
答案 0 :(得分:0)
您需要一个额外的库来执行阿拉伯字形加入。查看AR-PHP。