Menu

#639 n019003l.pfb error on gm convert -text operation

v1.0_(example)
closed-works-for-me
None
5
2024-09-10
2021-01-10
Aleksei
No

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].

Discussion

  • Bob Friesenhahn

    Bob Friesenhahn - 2021-01-10

    On Sun, 10 Jan 2021, Aleksei wrote:

    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].

    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.

    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].

    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

     
  • Bob Friesenhahn

    Bob Friesenhahn - 2021-01-10
    • status: open --> closed-works-for-me
    • assigned_to: Bob Friesenhahn
     
  • Bob Friesenhahn

    Bob Friesenhahn - 2021-01-10

    Guidance was provided.

     
  • Aleksei

    Aleksei - 2021-01-11

    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.

    I suggest that you use '/usr/share/fonts/TTF/DejaVuSans.ttf' if that is what you want.

    OK (it worked for me with full path), but gm's man page explicitly mentions only the filename in examples in "-font" section:

    -font <name> use this font when annotating the image with text
     You can tag a font to specify whether it is a PostScript, TrueType, or X11 font.  For example, Arial.ttf is a TrueType font, ps:helvetica is PostScript, and x:fixed is X11.
    

    If full path is required perhaps it should be mentioned as such in man page.

     
  • Colin Jacobs

    Colin Jacobs - 2024-09-05

    On ubuntu 24.04, installing the package fonts-urw-base35 doesn't put anything in /usr/share/fonts/type1/gsfonts. So, even with that installed, any call to gm convert -draw 'text' omitting a font or specifying a font name results in gm convert: Unable to read font (/usr/share/fonts/type1/gsfonts/n019003l.pfb).

    Explicitly setting the path to a font file does work.

     
  • Bob Friesenhahn

    Bob Friesenhahn - 2024-09-09

    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.

     
  • Bob Friesenhahn

    Bob Friesenhahn - 2024-09-10

    Please see issue 748 that I opened to address Debian bug 1019717.

     

Log in to post a comment.

MongoDB Logo MongoDB