The
imagefontheight() function is an inbuilt function in PHP which is used to get the pixel height of a character in the specified font.
Syntax:
int imagefontheight( int $font )
Parameters:This function accepts a single parameter
$font which holds the font value. Its value can be 1, 2, 3, 4, 5 for built-in fonts or can be used with
imageloadfont() for custom fonts.
Return Value: This function returns an integer value containing the height.
Below given programs illustrate the
imagefontheight() function in PHP:
Program 1:
Output:
Font height for font value 1 is 8
Font height for font value 2 is 13
Font height for font value 3 is 13
Font height for font value 4 is 16
Font height for font value 5 is 15
Program 2:
Output:
Font height for Pacifico is 8
Reference: https://www.php.net/manual/en/function.imagefontheight.php