Fatal error: Uncaught exception 'ImagickDrawException' with message 'The given font is not found in the ImageMagick configuration and the file (/var/www/Arial) is not accessible' in /var/www/captcha.php:20 Stack trace:
0 /var/www/captcha.php(20): ImagickDraw->setfont('Arial') #1
{main} thrown in /var/www/captcha.php on line 20
I am getting the following errors when i try the following
<?php
/* Create Imagick object */
$Imagick = new Imagick();
/* Set font and font size. You can also specify /path/to/font.ttf */
$ImagickDraw->setFont( 'Helvetica Regular' );
?>
You need to pass a filename to setFont()
, not a font name. E.g:
ImagickDraw->setFont('fonts/arial.ttf');
See the comment on the PHP manual page. Apparently this function only accepts filenames relative to the site root. It does not accept font names like Imagick::setFont()
does.