الصفحة الرئيسية
المزايا
المشروع
روابط مفيدة
تنزيل
الأسئلة الشائعة
النسخة القديمة
Related Class Documentation

<?php
  // Set the content-type
  header("Content-type: image/png");
  
  // Create the image
  $im = @imagecreatefromgif('GD/bg.gif');
  
  // Create some colors
  $black = imagecolorallocate($im, 0, 0, 0);
  $blue  = imagecolorallocate($im, 0, 0, 255);
  
  // Replace by your own font 
  // full path and name
  $local = $_SERVER['SCRIPT_FILENAME'];
  $pos   = strrpos($script, '/');
  $path  = substr($script, 0, $pos);
  $font  = $path.'/GD/ae_AlHor.ttf';
  
  // UTF-8 charset
  $text = 'بسم الله الرحمن الرحيم';

  imagettftext($im, 20, 0, 10,
               50, $blue, $font, 'UTF-8:');

  imagettftext($im, 20, 0, 200,
               50, $black, $font, $text);

  require('../I18N/Arabic.php');
  $Arabic = new I18N_Arabic('Glyphs');

  $text = 'بسم الله الرحمن الرحيم';
  $text = $Arabic->utf8Glyphs($text);

  imagettftext($im, 20, 0, 10,
          100, $blue, $font, 'ArGlyphs:');

  imagettftext($im, 20, 0, 200,
          100, $black, $font, $text);
  
  // Using imagepng() results in clearer 
  // text compared with imagejpeg()
  imagepng($im);
  imagedestroy($im);
?>
The first 90% of the task takes 90% of the time, and the last 10% takes the other 90%
أول 90% من المهمة تتطلب 90% من الوقت، فيما 10% المتبقية تتطلب 90% من الوقت بدورها
Index | Features | ArPHP Project | Useful Links | Download | PHP4!!!

Copyright © 2006 - 2021 Khaled Al-Sham'aa. All Rights Reserved | Sourceforge.net | GitHub.com | Terms Of Use

 

  If not now when? If not you and me who else? | إن لم يكن الآن فمتى؟ إن لم تكن أنت وأنا فمن غيرنا؟