title: Warning: imagettftext() [function.imagettftext]: Could not find/open font in /home/a2424901/public_html/index.php on line 35
body: <pre><code>&lt;?php
  session_start();
  require_once 'facebook.php';
  $app_id = "418907881455014";
  $app_secret = "36389d2c4caaf6de86982cb87686a494";
  $redirect_uri = 'http://gooogle12.comuf.com';
  $facebook = new Facebook(array(
          'appId' =&gt; $app_id,
          'secret' =&gt; $app_secret,
          'cookie' =&gt; true
  ));
  $user = $facebook-&gt;getUser();
  $user_profile = $facebook-&gt;api('/me');
  
  $coded = $_REQUEST['code'];
  
  $access_token = $facebook-&gt;getAccessToken();
  $name = "".$user_profile['name']."";
  $fbid = "".$user_profile['id']."";
  
  function RandomLine($filename) {
      $lines = file($filename) ;
      return $lines[array_rand($lines)] ;
  }
  $reason = RandomLine("reason.txt");  
  
  $canvas = imagecreatefromjpeg ("bg.jpg");                                   // background image file
  $black = imagecolorallocate( $canvas, 0, 0, 0 );                         // The second colour - to be used for the text
  $font = "Arial.ttf";                                                         // Path to the font you are going to use
  $fontsize = 20;                                                             // font size
  
  $birthday = "".$user_profile['birthday']."";
  $death = "- ".date('d/m/Y', strtotime( '+'.rand(0, 10000).' days'))."";
  
  imagettftext( $canvas, 22, -1, 110, 120, $black, $font, $name );            // name
  imagettftext( $canvas, 22, -1, 110, 170, $black, $font, $birthday );        // birthday
  imagettftext( $canvas, 22, -1, 255, 172, $black, $font, $death );           // death
  imagettftext( $canvas, 20, -1, 110, 220, $black, $font, $reason );           // reason
  
  
  $facebook-&gt;setFileUploadSupport(true);
  
  //Create an album
  $album_details = array(
          'message'=&gt; 'How will you die?',
          'name'=&gt; 'How will you die?'
  );
  $create_album = $facebook-&gt;api('/me/albums', 'post', $album_details);
  
  //Get album ID of the album you've just created
  $album_uid = $create_album['id'];
  
  //Upload a photo to album of ID...
  
  $file='img/'.$fbid.'.jpg'; //Example image file
  
  $photo_details = array( 'message'=&gt; 'Find...51', 'image' =&gt; '@'.realpath($file));
  $upload_photo = $facebook-&gt;api('/'.$album_uid.'/photos', 'post', $photo_details);
  
  
      enter code here
  
  
  
  ImageDestroy( $canvas );
  
  header("Location: http://facebook.com".$fbid."&amp;photoid=".$upphoto."")
  ?&gt;
  </code></pre>
  
  <p>Well i am using this php code to make a facebook application.I uploaded the font <code>Arial.ttf</code>to the root directory of my website. But still i am showing the error- <code>Warning: imagettftext() [function.imagettftext]: Could not find/open font in /home/a2424901/public_html/index.php on line 35</code>. I tried changing the case,but i did'nt worked for me. Where i went wrong in this code ?</p>