PHP | ImagickDraw setFontSize() Function Last Updated : 11 Jul, 2025 Summarize Comments Improve Suggest changes Share Like Article Like Report The ImagickDraw::setFontSize() function is an inbuilt function in PHP which is used to set the font point size. It is used when annotating with text. Syntax: bool ImagickDraw::setFontSize( $pointsize ) Parameters: This function accepts a single parameter $pointsize which is used to hold the value of point size.Return Value: This function does not return any value.Below programs illustrate the ImagickDraw::setFontSize() function in PHP:Program 1: php <?php // Create an ImagickDraw object $draw = new ImagickDraw(); // Set the image filled color $draw->setFillColor('Green'); // Set the Font Size $draw->setFontSize(30); // Set the font family $draw->setFontFamily('Ani'); // Set the text to be added $draw->annotation(30, 40, "GeeksForGeeks"); // Create new Imagick object $imagick = new Imagick(); // Set the image dimension $imagick->newImage(250, 70, 'white'); // Set the image format $imagick->setImageFormat("png"); // Draw the image $imagick->drawImage($draw); header("Content-Type: image/png"); // Display the image echo $imagick->getImageBlob(); ?> Output: Program 2: php <?php // Create an ImagickDraw object $draw = new ImagickDraw(); // Set the image filled color $draw->setFillColor('red'); // Set the Font Size $draw->setFontSize(40); // Set the Font family $draw->setFontFamily('Ubuntu-Mono'); // Set the text to be added $draw->annotation(30, 170, "GeeksForGeeks"); // Set the image filled color $draw->setFillColor('green'); // Set the font size $draw->setFontSize(30); // Set the font family $draw->setFontFamily('Open-Sans-Light-Italic'); // Set the text to be added $draw->annotation(30, 250, "Ubuntu-Mono"); // Create new Imagick object $imagick = new Imagick(); // Set the image dimension $imagick->newImage(350, 300, 'white'); // Set the image format $imagick->setImageFormat("png"); // Draw the image $imagick->drawImage($draw); header("Content-Type: image/png"); // Display the image echo $imagick->getImageBlob(); ?> Output: Reference: https://www.php.net/manual/en/imagickdraw.setfontsize.php Comment More infoAdvertise with us Next Article PHP | GmagickDraw setfontsize() Function S sarthak_ishu11 Follow Improve Article Tags : Technical Scripter Web Technologies PHP Image-Processing PHP-function PHP-Imagick +2 More Similar Reads PHP | GmagickDraw setfontsize() Function The Gmagick::setfontsize() function is an inbuilt function in PHP which is used to set the font size to use when annotating with text. Syntax: public GmagickDraw::setfontsize( $pointsize )  Parameters: This function accept single parameter $pointsize which is used to store font size. Return Value: 2 min read PHP | ImagickDraw setFont() Function The ImagickDraw::setFont() function is an inbuilt function in PHP which is used to set the fully-specified font to use when annotating with text. Syntax: bool ImagickDraw::setFont( $font_name ) Parameters: This function accepts a single parameter $font_name which is used to hold the value of font na 2 min read PHP | ImagickDraw setFontStyle() Function The ImagickDraw::setFontStyle() function is an inbuilt function in PHP which is used to set the font style to use when annotating with text. The AnyStyle enumeration acts as a wild-card "don't care" option. Syntax: bool ImagickDraw::setFontStyle( $style ) Parameters: This function accepts a single p 2 min read PHP | GmagickDraw setfont() function The GmagickDraw::setfont() function is an inbuilt function in PHP which is used to set the fully-specified font to use when annotating with text. Syntax: GmagickDraw GmagickDraw::setfont( string $font ) Parameters:This function accepts a single parameter $font which is used to hold the value of font 1 min read PHP | Imagick setPointSize() Function The Imagick::setPointSize() function is an inbuilt function in PHP which is used to set the point size of imagick object. Syntax: bool Imagick::setPointSize( int $point_size ) Parameters: This function accepts a single parameter $point_size which holds the size of point. Return Value: This function 1 min read PHP | GmagickDraw setfontstyle() Function The GmagickDraw::setfontstyle() function is an inbuilt function in PHP that is used to set the font style to use when annotating with text. Style enumeration acts as a wild-card don't care option. Syntax: public GmagickDraw::setfontstyle( $style ) : GmagickDraw Parameters: This function accepts a s 2 min read Like