ImageMagick: Error while running convert: convert: unable to read font
Asked Answered
S

3

74

I'm on Mountain Lion and installed ImageMagick using Homebrew (minimagick is also in my Gemfile but I don't think that's relevant). SimpleCaptcha uses it in a Rails app to create CAPTCHAs.

However, the image isn't created cause of this error:

Error while running convert: convert: unable to read font `/usr/local/share/ghostscript/fonts/n019003l.pfb' @ error/annotate.c/RenderFreetype/1123.
convert: Postscript delegate failed `/var/folders/gd/n7rzfhkd5jd0ws8jnzsz34hr0000gn/T/magick-vzHHz4ZP': No such file or directory @ error/ps.c/ReadPSImage/830.
convert: no images defined `/var/folders/gd/n7rzfhkd5jd0ws8jnzsz34hr0000gn/T/simple_captcha20121218-64930-1thtfpf.jpg' @ error/convert.c/ConvertImageCommand/3032.

Any ideas?

Scotticism answered 18/12, 2012 at 15:31 Comment(0)
S
160

Looks like you're missing ghostscript. If you are using Homebrew you can install it via:

$ brew install ghostscript
Shrewmouse answered 18/12, 2012 at 15:38 Comment(3)
Sometimes you have ghostscript but it's just not linked! $ brew unlink ghostscript && brew link ghostscriptDevonadevondra
This also works when the error message doesn't specifiy the missing font, as in convert: unable to read font `(null)' @ error/annotate.c/RenderFreetype/1153Fabrianna
is there anyone for windows help?Mousetail
K
0

if you are using Ubuntu or in a docker with Ubuntu remove and reinstall ghostscript package will fix your issue

apt remove ghostscript
apt install ghostscript

Kg answered 14/1, 2020 at 11:8 Comment(0)
M
0

In my situation, fc-list --format "%{fullname[0]}\n" was being used to obtain font names which did not agree with the output from convert -list font. But, convert -font will accept a full path instead of a font name (can be obtained from fc-list --format "%{file[0]}\n") which avoids name matching and location resolution issues.

This situation has been repaired in fontviewer.

Note: fc-list locates more fonts than convert -list font.

Mathias answered 21/12, 2023 at 18:42 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.