fixing /invalidfont in ghostscript

Recently I updated ghostscript, and it stopped working even on its own examples:

$ pwd
$ ps2pdf ~/a.pdf
ERROR: /invalidfont in findfont
Operand stack:
   (Palatino-Italic)   Font   (Palatino-Italic)   228176   (Palatino-
   Italic)   --nostringval--   (Palatino-Italic)   URWPalladioL-Ital
   Times-Italic   NimbusRomNo9L-ReguItal
Execution stack:

It seems there is some problem with fonts and search path. Probably, something is updated in the algorithm. I didn't have a lot of time to find what's wrong, so I implemented a quick fix.

First I run:

strace -o ~/gvtr ps2pdf ~/a.pdf

This command produced a trace file of executing "ps2pdf". I searched for "pfb" (an extension for Type1 fonts), and the first match was "p052023l.pfb". The program was unable to find this file. The file exists on the file system:

$ find /usr/share/fonts/ -name 'p052023l.pfb'

After thinking on the output from "gs -h", the section "Search path", I made a quick dirty fix, but it works for me:

# pwd
# ln -s /usr/share/fonts/default/Type1 fonts
Categories: publishing