Page 1 of 1

setfont,but setfontweight no work

Posted: 2010-10-13T03:02:07-07:00
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.