setfont,but setfontweight no work

IMagick is a native PHP extension to create and modify images using the ImageMagick API. ImageMagick Studio LLC did not write nor does it maintain the IMagick extension, however, IMagick users are welcome to discuss the extension here.
Post Reply
jackliangs

setfont,but setfontweight no work

Post by jackliangs »

Code: Select all

<?php
$Imagick = new Imagick();
$bg = new ImagickPixel();
$bg->setColor( 'white' );
$ImagickDraw = new ImagickDraw();
$ImagickDraw->setfont("/var/www/simkai.ttf");
$ImagickDraw->setFontSize( 20 );
$ImagickDraw->setfontweight(100);
$string = 'Az';
$Imagick->newImage( 600, 300, $bg ); 
$Imagick->annotateImage( $ImagickDraw, 4, 20, 0, $string );
$Imagick->drawImage( $ImagickDraw );
$Imagick->setImageFormat( 'png' );
header( "Content-Type: image/{$Imagick->getImageFormat()}" );
echo $Imagick->getImageBlob( );
?>
Set a font, while the effect of setting a bold, but bold is not in force, if not properly set the font bold. May I set the font does not contain a bold, but the algorithm should be bold freetype.

Code: Select all

<edit name="embolden" mode="assign"> 
             <bool>true</bool> 
         </edit> 
Please give me some help, thanks.
Post Reply