1--TEST--
2Test ImagickDraw, setTextAntialias
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 setTextAntialias($fillColor, $backgroundColor) {
18
19    $draw = new \ImagickDraw();
20    setFontForImagickDraw($draw);
21    $draw->setStrokeColor('none');
22    $draw->setFillColor($fillColor);
23    $draw->setStrokeWidth(1);
24    $draw->setFontSize(32);
25    $draw->setTextAntialias(false);
26    $draw->annotation(5, 30, "Lorem Ipsum!");
27    $draw->setTextAntialias(true);
28    $draw->annotation(5, 65, "Lorem Ipsum!");
29
30    $imagick = new \Imagick();
31    $imagick->newImage(220, 80, $backgroundColor);
32    $imagick->setImageFormat("png");
33    $imagick->drawImage($draw);
34
35    //Scale the image so that people can see the aliasing.
36    $imagick->scaleImage(220 * 6, 80 * 6);
37    $imagick->cropImage(640, 480, 0, 0);
38
39    $bytes = $imagick->getImageBlob();
40    if (strlen($bytes) <= 0) { echo "Failed to generate image.";}
41}
42
43setTextAntialias($fillColor, $backgroundColor) ;
44echo "Ok";
45?>
46--EXPECTF--
47Ok