1--TEST--
2Test ImagickDraw, setFontStyle
3--SKIPIF--
4<?php
5$imageMagickRequiredVersion=0x675;
6require_once(dirname(__FILE__) . '/skipif.inc');
7?>
8--FILE--
9<?php
10
11require_once(dirname(__FILE__) . '/functions.inc');
12
13$backgroundColor = 'rgb(225, 225, 225)';
14$strokeColor = 'rgb(0, 0, 0)';
15$fillColor = 'DodgerBlue2';
16
17function setFontStyle($fillColor, $strokeColor, $backgroundColor) {
18    $draw = new \ImagickDraw();
19    setFontForImagickDraw($draw);
20
21    $draw->setStrokeColor($strokeColor);
22    $draw->setFillColor($fillColor);
23    $draw->setStrokeWidth(1);
24    $draw->setFontSize(36);
25    $draw->setFontStyle(\Imagick::STYLE_NORMAL);
26    $draw->annotation(50, 50, "Lorem Ipsum!");
27
28    $draw->setFontStyle(\Imagick::STYLE_ITALIC);
29    $draw->annotation(50, 100, "Lorem Ipsum!");
30
31    $draw->setFontStyle(\Imagick::STYLE_OBLIQUE);
32    $draw->annotation(50, 150, "Lorem Ipsum!");
33
34    $imagick = new \Imagick();
35    $imagick->newImage(350, 300, $backgroundColor);
36    $imagick->setImageFormat("png");
37    $imagick->drawImage($draw);
38
39    $bytes = $imagick->getImageBlob();
40    if (strlen($bytes) <= 0) { echo "Failed to generate image.";}
41}
42
43setFontStyle($fillColor, $strokeColor, $backgroundColor) ;
44echo "Ok";
45?>
46--EXPECTF--
47Ok