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