array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'de', ), 'this' => array ( 0 => 'imagickdraw.setfont.php', 1 => 'ImagickDraw::setFont', 2 => 'Sets the fully-specified font to use when annotating with text', ), 'up' => array ( 0 => 'class.imagickdraw.php', 1 => 'ImagickDraw', ), 'prev' => array ( 0 => 'imagickdraw.setfillrule.php', 1 => 'ImagickDraw::setFillRule', ), 'next' => array ( 0 => 'imagickdraw.setfontfamily.php', 1 => 'ImagickDraw::setFontFamily', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/imagick/imagickdraw/setfont.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

ImagickDraw::setFont

(PECL imagick 2, PECL imagick 3)

ImagickDraw::setFontSets the fully-specified font to use when annotating with text

Beschreibung

public ImagickDraw::setFont(string $font_name): bool
Warnung

Diese Funktion ist bis jetzt nicht dokumentiert. Es steht nur die Liste der Parameter zur Verfügung.

Sets the fully-specified font to use when annotating with text.

Parameter-Liste

font_name

Rückgabewerte

Liefert true bei Erfolg.

Beispiele

Beispiel #1 ImagickDraw::setFont() example

<?php
function setFont($fillColor, $strokeColor, $backgroundColor) {

$draw = new \ImagickDraw();

$draw->setStrokeColor($strokeColor);
$draw->setFillColor($fillColor);

$draw->setStrokeWidth(2);
$draw->setFontSize(36);

$draw->setFont("../fonts/Arial.ttf");
$draw->annotation(50, 50, "Lorem Ipsum!");

$draw->setFont("../fonts/Consolas.ttf");
$draw->annotation(50, 100, "Lorem Ipsum!");

$draw->setFont("../fonts/CANDY.TTF");
$draw->annotation(50, 150, "Lorem Ipsum!");

$draw->setFont("../fonts/Inconsolata-dz.otf");
$draw->annotation(50, 200, "Lorem Ipsum!");

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

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

?>