PHP | imagefontheight() Function Last Updated : 14 Feb, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report 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: php <?php // Get the font height echo 'Font height for font value 1 is ' . imagefontheight(0) . '<br>'; echo 'Font height for font value 2 is ' . imagefontheight(2) . '<br>'; echo 'Font height for font value 3 is ' . imagefontheight(3) . '<br>'; echo 'Font height for font value 4 is ' . imagefontheight(4) . '<br>'; echo 'Font height for font value 5 is ' . imagefontheight(5) . '<br>'; ?> 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: php <?php // Get the font from local folder $font = imageloadfont('Pacifico.ttf'); // Show the output echo 'Font height for Pacifico is ' . imagefontheight($font); ?> Output: Font height for Pacifico is 8 Reference: https://www.php.net/manual/en/function.imagefontheight.php Comment More infoAdvertise with us Next Article PHP | imageloadfont() Function G gurrrung Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-Imagick Similar Reads PHP | imagefontwidth() Function The imagefontwidth() function is an inbuilt function in PHP which is used to get the pixel width of a character in the specified font. Syntax: int imagefontwidth( int $font ) Parameters: This function accept a single parameter $font which holds the font. It can be 1, 2, 3, 4, 5 for built-in fonts or 2 min read PHP | imagefttext() Function The imagefttext() function is an inbuilt function in PHP which is used write text to the image using fonts using FreeType 2. Syntax: array imagefttext( resource $image, float $size, float $angle, int $x, int $y, int $color, string $fontfile, string $text, array $extrainfo ) Parameters: This function 2 min read PHP | imagettftext() Function The imagettftext() function is an inbuilt function in PHP which is used to write text to the image using TrueType fonts. Syntax: array imagettftext( resource $image, float $size, float $angle, int $x, int $y, int $color, string $fontfile, string $text) Parameters: This function accept eight paramete 2 min read PHP | imagepng() Function The imagepng() function is an inbuilt function in PHP which is used to display image to browser or file. The main use of this function is to view an image in the browser, convert any other image type to PNG and applying filters to the image. Syntax: bool imagepng( resource $image, int $to, int $qual 2 min read PHP | imageloadfont() Function The imageloadfont() function is an inbuilt function in PHP which is used to load a new font. GDF fonts are supported which can be downloaded from here. Syntax: int imageloadfont( string $file ) Parameters: This function accepts a single parameter $file which holds the font. Return Value: This functi 2 min read PHP | imagestring() Function The imagestring() function is an inbuilt function in PHP which is used to draw the string horizontally. This function draws the string at given position. Syntax: bool imagestring( $image, $font, $x, $y, $string, $color ) Parameters: This function accepts six parameters as mentioned above and describ 2 min read Like