1--TEST--
2Test ImagickDraw, setFontFamily
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 setFontFamily($fillColor, $strokeColor, $backgroundColor) {
18
19    $draw = new \ImagickDraw();
20    setFontForImagickDraw($draw);
21
22    $strokeColor = new \ImagickPixel($strokeColor);
23    $fillColor = new \ImagickPixel($fillColor);
24
25    $draw->setStrokeColor($strokeColor);
26    $draw->setFillColor($fillColor);
27    //TODO - actually use setFontFamily
28    $draw->setStrokeWidth(2);
29
30    $draw->setFontSize(24);
31    $draw->annotation(50, 50, "Lorem Ipsum!");
32
33    $draw->setFontSize(36);
34    $draw->annotation(50, 100, "Lorem Ipsum!");
35
36    $draw->setFontSize(48);
37    $draw->annotation(50, 150, "Lorem Ipsum!");
38
39    $draw->setFontSize(60);
40    $draw->annotation(50, 200, "Lorem Ipsum!");
41
42    $draw->setFontSize(72);
43    $draw->annotation(50, 250, "Lorem Ipsum!");
44
45    $imagick = new \Imagick();
46    $imagick->newImage(500, 500, $backgroundColor);
47    $imagick->setImageFormat("png");
48    $imagick->drawImage($draw);
49
50    $bytes = $imagick->getImageBlob();
51    if (strlen($bytes) <= 0) { echo "Failed to generate image.";}
52}
53
54setFontFamily($fillColor, $strokeColor, $backgroundColor) ;
55echo "Ok";
56?>
57--EXPECTF--
58Ok