Get font width with imagefontwidth() together with imageloadfont() in PHP

Description

The following code shows how to get font width with imagefontwidth() together with imageloadfont().

Example


<?php/*  w  ww  .  j a v a2  s. c o m*/
// Load a .gdf font
$font = imageloadfont('anonymous.gdf');

echo 'Font width: ' . imagefontwidth($font);
?>




















Home »
  PHP Tutorial »
    Image »




Color
Create
Font
Operation
Shape
Text