1--TEST-- 2Test Tutorial, psychedelicFont 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 13function psychedelicFont() { 14 $draw = new \ImagickDraw(); 15 setFontForImagickDraw($draw); 16 $name = 'Danack'; 17 18 $draw->setStrokeOpacity(1); 19 $draw->setFillColor('black'); 20 21 $draw->setfontsize(150); 22 23 for ($strokeWidth = 25; $strokeWidth > 0; $strokeWidth--) { 24 $hue = intval(170 + $strokeWidth * 360 / 25); 25 $draw->setStrokeColor("hsl($hue, 255, 128)"); 26 $draw->setStrokeWidth($strokeWidth * 3); 27 $draw->annotation(60, 165, $name); 28 } 29 30 //Create an image object which the draw commands can be rendered into 31 $imagick = new \Imagick(); 32 $imagick->newImage(650, 230, "#eee"); 33 $imagick->setImageFormat("png"); 34 35 //Render the draw commands in the ImagickDraw object 36 //into the image. 37 $imagick->drawImage($draw); 38 39 //Send the image to the browser 40 $bytes = $imagick->getImageBlob(); 41 if (strlen($bytes) <= 0) { echo "Failed to generate image.";} 42} 43 44psychedelicFont() ; 45echo "Ok"; 46?> 47--EXPECTF-- 48Ok