Earlier while troubleshooting an issue for a client of mine I ran into an issue when testing HylaFAX’s sendfax via the CLI. The error complained of some font files that appear to have been previously upgraded by someone else on the server which is running a fairly old version of Ubuntu Linux. Anyhow the error along with the quick resolution to the issue are noted below.
HylaFAX sendfax Font Error:
root@dev:/etc/hylafax# sendfax -n -d 5021231234 /root/test textfmt: No font metric information found for "Courier-Bold". Usage: textfmt [-1] [-2] [-B] [-c] [-D] [-f fontname] [-F fontdir(s)] [-m N] [-o #] [-p #] [-r] [-U] [-Ml=#,r=#,t=#,b=#] [-V #] files... >out.ps Default options: -f Courier -1 -p 11bp -o 0 Error converting document; command was "textfmt -B -f Courier-Bold -Ml=0.4in -p 11 -s default >'/tmp//sndfaxDVkjXF' <'/root/test'" root@dev:/etc/hylafax#
Resolve HylaFAX sendfax Font Error:
To resolve this issue simply issue the below command to locate the Fontmap and Fontmap.gs files on the server. After locating the Fontmap files you will then add them to the Fontmap variable in the hyla.conf configuration file.
Locate Fontmap Files On Ubuntu Linux:
root@dev:/etc/hylafax# locate Fontmap /usr/share/ghostscript/8.61/lib/Fontmap /usr/share/ghostscript/8.61/lib/Fontmap.GS /var/lib/defoma/gs.d/dirs/fonts/Fontmap
In this scenario we are concerned with the “/usr/share/ghostscript/8.61/lib/” directory which we will add to the hyla.conf file located in /etc/hylafax.
Modify hyla.conf Fontmap Variable With Fontmap Location On Ubuntu Linux:
If there is more than one location of Fontmap or Fontmap.gs you can add multiple locations by separating them with colons such as the below.
/etc/hylafax/hyla.conf Fontmap Variable With Multiple Fontmap Locations:
Now restart hylafax using /etc/init.d/hylafax restart and you should no longer receive the font error when sending text files via sendfax.