1--TEST--
2Test ImagickDraw, setTextUnderColor
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$textUnderColor = 'DeepPink2';
17
18function setTextUnderColor($strokeColor, $fillColor, $backgroundColor, $textUnderColor) {
19    $draw = new \ImagickDraw();
20    setFontForImagickDraw($draw);
21
22    $draw->setStrokeColor($strokeColor);
23    $draw->setFillColor($fillColor);
24    $draw->setStrokeWidth(2);
25    $draw->setFontSize(72);
26    $draw->annotation(50, 75, "Lorem Ipsum!");
27    $draw->setTextUnderColor($textUnderColor);
28    $draw->annotation(50, 175, "Lorem Ipsum!");
29
30    $imagick = new \Imagick();
31    $imagick->newImage(500, 500, $backgroundColor);
32    $imagick->setImageFormat("png");
33
34    $imagick->drawImage($draw);
35
36    $bytes = $imagick->getImageBlob();
37    if (strlen($bytes) <= 0) { echo "Failed to generate image.";}
38}
39
40setTextUnderColor($strokeColor, $fillColor, $backgroundColor, $textUnderColor) ;
41echo "Ok";
42?>
43--EXPECTF--
44Ok