imagefontheight

(PHP 4, PHP 5, PHP 7)
Get font height
int imagefontheight ( int $font )

Returns the pixel height of a character in the specified font.

Parameters:
font

Can be 1, 2, 3, 4, 5 for built-in fonts in latin2 encoding (where higher numbers corresponding to larger fonts) or any of your own font identifiers registered with imageloadfont().

Returns:

Returns the pixel height of the font.

Examples:
Using imagefontheight() on built-in fonts
<?php
echo 'Font height: ' . imagefontheight(4);
?>

The above example will output something similar to:

Font height: 16
Using imagefontheight() together with imageloadfont()
<?php
// Load a .gdf font
$font = imageloadfont('anonymous.gdf');

echo 'Font height: ' . imagefontheight($font);
?>

The above example will output something similar to:

Font height: 43
See also:

imagefontwidth() -

imageloadfont() -

doc_php
2016-02-24 15:59:46
Comments
Leave a Comment

Please login to continue.