dongshi8425 2011-02-19 06:32
浏览 26
已采纳

Imagemagick与PHP

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' );


?>
  • 写回答

1条回答 默认 最新

  • du958642589 2011-02-19 08:01
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题