Advertisement
Guest User

Untitled

a guest
Feb 10th, 2014
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.81 KB | None | 0 0
  1. <?php
  2.  // Create the image
  3.  $im = imagecreatetruecolor(400, 30);
  4.  
  5.  // Create some colors
  6.  $white = imagecolorallocate($im, 255, 255, 255);
  7.  $grey = imagecolorallocate($im, 128, 128, 128);
  8.  $black = imagecolorallocate($im, 0, 0, 0);
  9.  imagefilledrectangle($im, 0, 0, 399, 29, $white);
  10.  
  11.  // The text to draw
  12.  $text = '⨀ ⨁ ⨂ ⨃ ⨄ ⨅ ⨆ ⨇ ⨈ ⨉ ⨊ ⨋ ⨌ ⨍ ⨎ ⨏ ⨐ ⨑ ⨒ ⨓ ⨔ ⨕ ⨖ ⨗ ⨘ ⨙ ⨚ ⨛ ⨜ ⨝ ⨞ ⨟';
  13.  // Replace path by your own font path
  14.  $font = 'unifont-6.3.20131221.ttf';
  15.  
  16.  // Add some shadow to the text
  17.  imagettftext($im, 20, 0, 11, 21, $grey, $font, $text);
  18.  
  19.  // Add the text
  20.  imagettftext($im, 20, 0, 10, 20, $black, $font, $text);
  21.  
  22.  // Using imagepng() results in clearer text compared with imagejpeg()
  23.  imagepng($im, 'test.png');
  24.  imagedestroy($im);
  25.  ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement