n019003l.pfb error on gm convert -text operation
Swiss army knife of image processing
Brought to you by:
bfriesen
Hi,
I'm trying to place a string on the image, starting with example from man page:
$ gm convert woodpecker.png -draw 'text 100,100 "String01"' temp1.png
gm convert: Unable to read font (/usr/share/fonts/Type1/n019003l.pfb) [No such file or directory].
Tried specifying the font (file /usr/share/fonts/TTF/DejaVuSans.ttf exists), same error:
$ gm convert -font 'DejaVuSerif.ttf' -draw 'text 100,100 "%m:%f %wx%h"' woodpecker.png temp1.png
gm convert: Unable to read font (/usr/share/fonts/Type1/n019003l.pfb) [No such file or directory].
On Sun, 10 Jan 2021, Aleksei wrote:
This could happen if you don't have the URL font package installed.
You did not say what operating system you are using but if you take a
look at http://www.graphicsmagick.org/INSTALL-unix.html and search for
"--with-gs-font-dir" you will see a list of package names which will
deliver the URW fonts on some popular distributions/systems.
The URW fonts are similar to the set of standard fonts provided on
Postscript printers.
I suggest that you use '/usr/share/fonts/TTF/DejaVuSans.ttf' if that
is what you want.
Bob
Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/
Public Key, http://www.simplesystems.org/users/bfriesen/public-key.txt
Guidance was provided.
Thanks for your reply Bob.
ArchLinux here, looks like distro build script points --with-gs-font-dir to non-existent directory, thanks for the pointer.
OK (it worked for me with full path), but gm's man page explicitly mentions only the filename in examples in "-font" section:
If full path is required perhaps it should be mentioned as such in man page.
On ubuntu 24.04, installing the package
fonts-urw-base35doesn't put anything in/usr/share/fonts/type1/gsfonts. So, even with that installed, any call togm convert -draw 'text'omitting a font or specifying a font name results ingm convert: Unable to read font (/usr/share/fonts/type1/gsfonts/n019003l.pfb).Explicitly setting the path to a font file does work.
Colin Jacobs, it is not useful to post to an old closed issue since no one will notice your comment. I expect that you have run into Debian bug 1019717, which is actually a new issue due to a change in the font packages. I do not yet have Ubuntu 24.04 LTS here, but expect to once an upgrade is offered.
Please see issue 748 that I opened to address Debian bug 1019717.