<?php header('Content-Type: image/png'); include 'word2uni.php'; $image = imagecreatetruecolor(200, 75); imagefill($image, 0, 0, 0xaaaaaa); if (isset($_GET['word'])) { $text = word2uni($_GET['word']); } else { $text = word2uni('العربية'); } imagettftext($image, 25, 0, 20, 50, 0x0, 'arial.ttf', $text); imagepng($image);
$word = $words[0]; //var_dump($word); header("Content-type: image/jpeg"); error_reporting(0); require_once __DIR__ . '/libs/I18N/Arabic.php'; require_once __DIR__ . '/libs/word2uni/word2uni.php'; $ar = new I18N_Arabic('Glyphs'); $imgPath = __DIR__ . '/templates/stc.jpg'; $image = imagecreatefromjpeg($imgPath); $color = imagecolorallocate($image, 0, 0, 0); $string = $word['word']; $fontSize = 50; $x = 115; $y = 300; //imagettftext ( resource $im, int $size, int $angle, int $x, int $y, int $color, string $fontfile, string $text ) imagettftext($image, $fontSize, 0, $x, $y, $color, __DIR__ . '/templates/fonts/tradbdo.ttf', word2uni($string)); //imagestring($image, $fontSize, $x, $y, $string, $color); imagejpeg($image); exit; break; } function set_filehtml($filename) { global $datadir; global $filehtml; $filepath = $datadir . "/{$filename}"; $filehtml = file_get_contents($filepath); } function revUni($text) { $wordsArray = explode(" ", $text);