ImagickDraw::setFontStyle

(PECL imagick 2, PECL imagick 3)

ImagickDraw::setFontStyleYazı tipi tarzını belirler

Açıklama

public ImagickDraw::setFontStyle(int $tarz): bool
Uyarı

Bu işlev hala belgelendirilmemiştir; sadece değiştirge listesi mevcuttur.

Metni çizerken kullanılacak yazı tipi tarzını belirler.

Değiştirgeler

style

Yazı tipi tarzı sabitlerinden biri.

Dönen Değerler

Hiçbir değer dönmez.

Örnekler

Örnek 1 - ImagickDraw::setFontStyle() örneği

<?php
function setFontStyle($fillColor$strokeColor$backgroundColor) {
    
$draw = new \ImagickDraw();
    
$draw->setStrokeColor($strokeColor);
    
$draw->setFillColor($fillColor);
    
$draw->setStrokeWidth(1);
    
$draw->setFontSize(36);
    
$draw->setFontStyle(\Imagick::STYLE_NORMAL);
    
$draw->annotation(5050"Lorem Ipsum!");

    
$draw->setFontStyle(\Imagick::STYLE_ITALIC);
    
$draw->annotation(50100"Lorem Ipsum!");

    
$draw->setFontStyle(\Imagick::STYLE_OBLIQUE);
    
$draw->annotation(50150"Lorem Ipsum!");

    
$imagick = new \Imagick();
    
$imagick->newImage(350300$backgroundColor);
    
$imagick->setImageFormat("png");
    
$imagick->drawImage($draw);

    
header("Content-Type: image/png");
    echo 
$imagick->getImageBlob();
}

?>

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top