imagefontwidth

Get font width

&reftitle.description; `int` `imagefontwidth` ``GdFont``int```font`

Returns the pixel width of a character in font.

&reftitle.parameters;

&gd.font.description;
&reftitle.returnvalues;

Returns the pixel width of the font.

&reftitle.changelog;

&Version; | &Description;
&gd.changelog.gdfont-instance;

&reftitle.examples;

### Using `imagefontwidth` on built-in fonts

    <?php
    echo 'Font width: ' . imagefontwidth(4);
    ?>

&example.outputs.similar;

    Font width: 8

### Using `imagefontwidth` together with `imageloadfont`

    <?php
    // Load a .gdf font
    $font = imageloadfont('anonymous.gdf');

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

&example.outputs.similar;

    Font width: 23

&reftitle.seealso;

- `imagefontheight`
- `imageloadfont`