PHP | GmagickDraw getfont() Function Last Updated : 23 Jan, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report The GmagickDraw::getfont() function is an inbuilt function in PHP which is used to get the string specifying the font used when annotating with text. Syntax: string GmagickDraw::getfont( void ) Parameters: This function doesn’t accept any parameters. Return Value: This function returns an string value containing the font. Exceptions: This function throws GmagickDrawException on error. Below given programs illustrate the GmagickDraw::getfont() function in PHP: Program 1: php <?php // Create a new GmagickDraw object $draw = new GmagickDraw(); // Get the font $font = $draw->getfont(); echo $font; ?> Output: Empty string which is the default font. Used Image: Program 2: php <?php // Create a new Gmagick object $gmagick = new Gmagick('geeksforgeeks.png'); // Create a GmagickDraw object $draw = new GmagickDraw(); // Set the color $draw->setFillColor('#0E0E0E'); // Draw rectangle for background $draw->rectangle(-10, -10, 800, 400); // Set the fill color $draw->setFillColor('yellow'); // Set the font size $draw->setFontSize(20); // Set the font to a ttf file which should be // placed in same folder where the program is. $draw->setFont('Pacifico.ttf'); // Annotate a text $draw->annotate(50, 120, 'The Font here is ' . $draw->getfont() . '.'); // Use of drawimage functeannotate $gmagick->drawImage($draw); // Display the output image header("Content-Type: image/png"); echo $gmagick->getImageBlob(); ?> Output: Reference: https://www.php.net/manual/en/gmagickdraw.getfont.php Comment More infoAdvertise with us Next Article PHP | GmagickDraw getfontweight() Function G gurrrung Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-Gmagick Similar Reads PHP | ImagickDraw getFont() Function The ImagickDraw::getFont() function is an inbuilt function in PHP which is used to get the string specifying the font used when annotating with text. Syntax: string ImagickDraw::getFont( void ) Parameters: This function doesnât accepts any parameters. Return Value: This function returns an string va 2 min read PHP | GmagickDraw getfontsize() Function The Gmagick::getfontsize() function is an inbuilt function in PHP which is used to return the font pointsize. Syntax: public GmagickDraw::getfontsize( void ) Â Parameters: This function does not accept any parameter. Return Value: This function returns the font pointsize associated with the current 2 min read PHP | GmagickDraw getfontstyle() Function The GmagickDraw::getfontstyle() function is an inbuilt function in PHP which is used to get the font style used when annotating with text. Syntax: int GmagickDraw::getfontstyle( void ) Parameters: This function doesnât accept any parameters. Return Value: This function returns an integer value corre 2 min read PHP | GmagickDraw getfontweight() Function The GmagickDraw::getfontweight() function is an inbuilt function in PHP which is used to get the font-weight used when annotating with text. Font weight actually signifies the boldness of the font, more the font-weight the more the bold text will be. It can be anything from 100 to 900. Syntax: int G 2 min read PHP | ImagickDraw getFontSize() Function The ImagickDraw::getFontSize() function is an inbuilt function in PHP which is used to get the font pointsize used when annotating with text. Syntax: float ImagickDraw::getFontSize( void ) Parameters: This function doesnât accept any parameter. Return Value: This function returns a float value conta 1 min read PHP | ImagickDraw getFontStyle() Function The ImagickDraw::getFontStyle() function is an inbuilt function in PHP which is used to get the font style used when annotating with text. Syntax: int ImagickDraw::getFontStyle( void ) Parameters: This function doesnât accepts any parameters. Return Value: This function returns an integer value corr 2 min read Like