PHP | ImagickDraw getFont() Function Last Updated : 19 Dec, 2019 Comments Improve Suggest changes Like Article Like Report 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 value containing the name of the font. Exceptions: This function throws ImagickException on error. Below programs illustrate the ImagickDraw::getFont() function in PHP: Program 1: php <?php // Create a new ImagickDraw object $draw = new ImagickDraw(); // Get the font $font = $draw->getFont(); echo $font; ?> Output: Empty string which is the default font. Program 2: php <?php // Create a new ImagickDraw object $draw = new ImagickDraw(); // Set the font to a font file name which // should be present in the same folder $draw->setFont('roboto.ttf'); // Get the font $font = $draw->getFont(); echo $font; ?> Output: /home/user/php/roboto.ttf Program 3: php <?php // Create a new imagick object $imagick = new Imagick(); // Create a image on imagick object $imagick->newImage(800, 250, 'yellow'); // Create a new ImagickDraw object $draw = new ImagickDraw(); // Set the font size $draw->setFontSize(30); // Annotate a text $draw->annotation(50, 100, 'The Font here is default.'); // 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->annotation(50, 200, 'The Font here is ' . $draw->getFont() . '.'); // Render the draw commands $imagick->drawImage($draw); // Show the output $imagick->setImageFormat('png'); header("Content-Type: image/png"); echo $imagick->getImageBlob(); ?> Output: Reference: https://www.php.net/manual/en/imagickdraw.getfont.php Comment More infoAdvertise with us Next Article PHP | ImagickDraw getFont() Function gurrrung Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-Imagick Similar Reads PHP | GmagickDraw getfont() Function 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 val 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 PHP | Imagick getFont() Function The Imagick::getFont() function is an inbuilt function in PHP which is used to get the font. Syntax: int Imagick::getFont( void ) Parameters: This function doesn't accept any parameters. Return Value: This function returns a string containing address of font file on success. Below program illustrate 1 min read PHP | ImagickDraw getFontFamily() Function The ImagickDraw::getFontFamily() function is an inbuilt function in PHP which is used to get the font family to use when annotating with text. It tells the specific size and style of text to be used and there are many font-families available like Times, AvantGarde, NewCenturySchlbk, Palatino, etc. S 2 min read PHP | ImagickDraw getFontWeight() Function The ImagickDraw::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 I 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 getFillColor() Function The ImagickDraw::getFillColor() function is an inbuilt function in PHP which is used to get the fill color used for drawing filled objects. Syntax: ImagickPixel ImagickDraw::getFillColor( void ) Parameters: This function doesnât accept any parameter. Return Value: This function returns an ImagickPix 2 min read Like