The TrueType Font Bounding Box : TrueType Fonts « Graphics Image « PHP






The TrueType Font Bounding Box

<?php
     header ("Content-type: image/png");
   
     $font_size = 15;
     $im = ImageCreate (300, 500);
     $grey = ImageColorAllocate ($im, 230, 230, 230);
     $black = ImageColorAllocate ($im, 0, 0, 0);
     $bbox = ImageTTFBBox($font_size, 0, "ARIALBD.TTF", "Bounding Box!");
   
     for($i = 0; $i < 7; $i++){
          ImageTTFText($im, $font_size, 0, 10, ($i * ($font_size * 2)) + 25,$black, "ARIALBD.TTF", "\$bbox[$i] = $bbox[$i]");
     }
     ImagePng ($im);
     ImageDestroy ($im);
?>
           
       








Related examples in the same category

1.Use TrueType Fonts