小编EAA*_*EAA的帖子

ImageMagick 转换命令无法读取字体

我正在将 ImageMagick 命令集成到用 Node.js 编写的 Firebase 函数中。我已经安装了 Ghostscript 并拥有可用字体的完整列表:

convert -list font

Path: /usr/local/Cellar/imagemagick/7.0.8-10/etc/ImageMagick-7/type-apple.xml
  Font: AndaleMono
    family: Andale Mono
    style: Undefined
    stretch: Undefined
    weight: 0
    glyphs: /Library/Fonts//Andale Mono.ttf
  Font: AppleChancery
    family: Apple Chancery
    style: Undefined
    stretch: Undefined
    weight: 0
    glyphs: /Library/Fonts//Apple Chancery.ttf
  Font: AppleMyungjo
    family: AppleMyungjo
    style: Undefined
    stretch: Undefined
    weight: 0
    glyphs: /Library/Fonts//AppleMyungjo.ttf
Run Code Online (Sandbox Code Playgroud)

这是我的代码:

exec(`convert ${tempFilePath} -font /Users/emma/Library/Fonts/Nunito-Regular.ttf -fill white -pointsize 60 -gravity center -draw "text 0,300 'this is a label'" ${tempFilePath}`, {stdio: 'ignore'}, (err, stdout) => {
         if …
Run Code Online (Sandbox Code Playgroud)

fonts imagemagick node-imagemagick imagemagick-convert

7
推荐指数
1
解决办法
3999
查看次数