PHP | Imagick setFont() Function Last Updated : 17 Aug, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report The Imagick::setFont() function is an inbuilt function in PHP which is used to set the font. Syntax: bool Imagick::setFont( string $font ) Parameters: This function accepts single parameter $font which holds the name of font file. Return Value: This function returns TRUE on success. Extensions: GD extension needs to be installed for this function. Below programs illustrate the Imagick::getFont() function in PHP: Program 1: php <?php // Create a new imagick object $imagick = new Imagick(); // Use setFont() function to set the // font using .ttf font file. The .ttf // file is placed in same folder $imagick->setFont('Windsong.ttf'); // Write a caption in image format $imagick->newPseudoImage(800, 350, "caption:GeekforGeeks"); // Show the output $imagick->setformat('png'); header("Content-Type: image/png"); echo $imagick->getImageBlob(); ?> Output: Program 2: php <?php // Create a new imagick object $imagick = new Imagick(); // Set the font - make sure .ttf font file // is placed in same folder $imagick->setFont('FFF_Tusj.ttf'); // Write the caption in a image $imagick->newPseudoImage(800, 350, "caption:GeekforGeeks"); // Show the output $imagick->setformat('png'); header("Content-Type: image/png"); echo $imagick->getImageBlob(); ?> Output: Reference: https://www.php.net/manual/en/imagick.setfont.php Comment More infoAdvertise with us Next Article PHP | GmagickDraw setfont() function G gurrrung Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-Imagick Similar Reads 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 | Imagick setFormat() Function The Imagick::setFormat() function is an inbuilt function in PHP which is used to set the format of the Imagick object. Syntax: bool Imagick::setFormat( string $format ) Parameters: This function accepts a single parameter $format which holds an string value. Return Value: This function returns TRUE 1 min read PHP | Imagick setOption() Function The Imagick::setOption() function is an inbuilt function in PHP which is used to set an option. Syntax: bool Imagick::setOption( string $key, string $value ) Parameters: This function accepts two parameters as mentioned above and described below: $key: It specifies the key for the option. $value: It 1 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 | Imagick queryFonts() Function The Imagick::Imagick::queryFonts function is an inbuilt function in PHP which is used to returns the configured fonts of Imagick library. Syntax: array Imagick::queryFonts( $pattern = "*" ) Parameters: This function accepts single parameter $pattern which stores the value of the query pattern. Retur 1 min read Like