1--TEST--
2Test ImagickDraw, setFontSize
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 setFontSize($fillColor, $strokeColor, $backgroundColor) {
18
19    $draw = new \ImagickDraw();
20
21    setFontForImagickDraw($draw);
22
23    $draw->setStrokeOpacity(1);
24    $draw->setStrokeColor($strokeColor);
25    $draw->setFillColor($fillColor);
26    $draw->setStrokeWidth(2);
27
28    $sizes = array(24, 36, 48, 60, 72);
29
30    foreach ($sizes as $size) {
31        $draw->setFontSize($size);
32        $draw->annotation(50, ($size * $size / 16), "Lorem Ipsum!");
33    }
34
35    $imagick = new \Imagick();
36    $imagick->newImage(500, 500, $backgroundColor);
37    $imagick->setImageFormat("png");
38    $imagick->drawImage($draw);
39
40    $bytes = $imagick->getImageBlob();
41    if (strlen($bytes) <= 0) { echo "Failed to generate image.";}
42}
43
44setFontSize($fillColor, $strokeColor, $backgroundColor) ;
45echo "Ok";
46?>
47--EXPECTF--
48Ok