PHP | ImagickDraw setTextInterlineSpacing() Function
Last Updated :
17 Dec, 2019
The ImagickDraw::setTextInterlineSpacing() function is an inbuilt function in PHP which is used to set the text interline spacing.
Syntax:
bool ImagickDraw::setTextInterlineSpacing( float $spacing )
Parameters: This function accepts a single parameter $spacing which holds the text interline spacing.
Return Value: This function returns TRUE on success.
Below programs illustrate the ImagickDraw::setTextInterlineSpacing() function in PHP:
Program 1:
<?php
$draw = new ImagickDraw();
$draw ->setTextInterLineSpacing(15);
$textInterlineSpacing = $draw ->getTextInterLineSpacing();
echo $textInterlineSpacing ;
?>
|
Output:
15
Program 2:
<?php
$imagick = new Imagick();
$imagick ->newImage(800, 250, 'white' );
$draw = new ImagickDraw();
$draw ->setFillColor( 'green' );
$draw ->setFontSize(40);
$draw ->setTextInterLineSpacing(40);
$draw ->annotation(350, 70, "Geeks \nfor\nGeeks" );
$imagick ->drawImage( $draw );
$imagick ->setImageFormat( 'png' );
header( "Content-Type: image/png" );
echo $imagick ->getImageBlob();
?>
|
Output:
Reference: https://www.php.net/manual/en/imagickdraw.settextinterlinespacing.php
Share your thoughts in the comments
Please Login to comment...