Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2416
  • Last Modified:

HYLAFAX: no font metric information found


I compiled Hylafax from source on a Fedora 11 system.
It seems to me that I have previously yum-installed all the required packages.
I run some tests and I get the following error:

[root@faxserver hylafax-6.0.4]# sendfax -d 555555 /root/test
/usr/local/sbin/textfmt: No font metric information found for "Courier-Bold".
Usage: /usr/local/sbin/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 "/usr/local/sbin/textfmt -B -f Courier-Bold      -Ml=0.4in -p 11 -s default >'/tmp//sndfaxsicQ43' <'/root/test'"

I installed ghostscript and ghostscript-font via yum.

Please HELP!
  • 6
  • 3
  • 2
1 Solution
Duncan RoeSoftware DeveloperCommented:
It may help if you rebuild hylafax after running ./configure --prefix=/usr. Packages you install with yum go under /usr (/usr/bin, /usr/lib, /usr/sbin &c.). Packages you compile yourself go by default under /usr/local. It is possible that /usr/local/sbin/textfmt only looks in /usr/local whereas the fonts are to be found in /usr.
You might be able to confirm this by running strace, e.g.:-

strace -f -eopen  /usr/local/sbin/textfmt -B -f Courier-Bold      -Ml=0.4in -p 11 -s default >'/tmp//sndfaxsicQ43' <'/root/test'

This should give you a trace of all files textfmt tries to open. Look for failed attempts. If you can't see any, miss out "-eopen" and look backwards from the end of the copious output for any failed system calls. You can divert the strace output to a file bu appending 2> to the command line, e.g.:-

strace -f  /usr/local/sbin/textfmt -B -f Courier-Bold      -Ml=0.4in -p 11 -s default >'/tmp//sndfaxsicQ43' <'/root/test'  2>/tmp/foo
nociSoftware EngineerCommented:
textfmt is looking for the file Fontmap.GS or Fontmap.

Mine is in /etc/fonts (Gentoo, YMMV..) and it describes all fonts on the system.

This needs to be set in the hyla.conf file (mine is in /usr/lib/fax/)
again yours may be somewhere else... (/usr/local/lib/fax?)
nociSoftware EngineerCommented:
In the hyla.conf file it needs to be mentioned after the FontMap tag.
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

mlattariAuthor Commented:
Duncan roe: thanks for the PRECISE suggestion! Using strace I found out that i completely miss the file Courier-Bold.afm and other .afm files, although I yum-installed ghostscript 8.70 and ghostscript-fonts 5.50. What package should I install to get the files? I have temporarily changed the ASCII to Postscript conversion utility from textfmt to enscript (/usr/local/lib/fax/typerules) and it seems to work well without the missing files. Strange...but it works :-) Should I use enscript or try to install the missing files and use textfmt? What do You suggest me to do?

Duncan RoeSoftware DeveloperCommented:
It's an OpenOffice file. Mine is at /usr/lib/ooo-1.1/share/psprint/fontmetric/Courier-Bold.afm (that was for OpenOffice 1.1). Have you installed OpenOffice yet?
nociSoftware EngineerCommented:
or for openoffice 3.1 the FontMap path would include:

and you depend on openoffice to keep it straight...
and it changes when ooo changes.
mlattariAuthor Commented:
hmmm.... I have a simple text-installation on the server :-) It is ncessary to install Open Office to have the fontmetric files?
nociSoftware EngineerCommented:

the AFM files would be delivered with each font.
THe FontMap file is application specific (content wise, which fonts do you allow to be used/replaced and wat is the sizing)... from font string -> font file.

Did you try to "find /  -iname 'fontmap.gs' -o -iname 'fontmap' -ls"   (without the " and with the ') to get the right name.
If you find them try to add the path to the files to the FontMap entry in the hyla.conf file.
(also faxsetup would create such a hyla.conf file if it doesn't exist).
nociSoftware EngineerCommented:
BTW, there is a version number in the Ghostscript font paths which might prevent the normal lookup.)
mlattariAuthor Commented:
Thanks Noci...

I have already created the file hyla.conf file and Hylafax added some entries there. I have also the Fontmap and the Fontmap.GS files in the right places but i miss Courier-Bold.afm and perhaps all other metric files. I don't understand why...

The Fontmap file (I moved It from Fontmap.GS and it has the contents of Fontmap.GS) is in  /usr/share/ghostscript/8.70/Resource/Init/Fontmap.....

I miss the font-metric files not the Fontmap. The paths in hyla.conf are OK too...

It work now well to send faxes from ASCII text because I use enscript instead od textfmt but I dont know if it is a good idea...

[root@faxserver ~]# cat /usr/local/lib/fax/hyla.conf
FontMap:   /usr/share/ghostscript/8.70/Resource/Init:/usr/share/ghostscript/8.70/lib:/usr/share/ghostscript/8.70/Resource/Font:/usr/share/ghostscript/fonts:/usr/share/fonts/default/ghostscript:/usr/share/fonts/default/Type1:/usr/share/fonts/default/a
FontPath:  /usr/share/ghostscript/8.70/Resource/Init:/usr/share/ghostscript/8.70/lib:/usr/share/ghostscript/8.70/Resource/Font:/usr/share/ghostscript/fonts:/usr/share/fonts/default/ghostscript:/usr/share/fonts/default/Type1:/usr/share/fonts/default/amspsfnt/pfb:/usr/share/fonts/default/cmpsfont/pfb:/usr/share/fonts:/usr/share/ghostscript/conf.d:/etc/ghostscript:/etc/ghostscript/8.70

Open in new window

nociSoftware EngineerCommented:
In the fontmap file there is this entry:  (grep Courier-Bold ..../Fontmap)
/Courier-Bold (/usr/share/fonts/Type1/courb.pfa) ;

which would mean that courier bold can be found in:... /usr/share/fonts/Type1/courb.pfa

ls -l /usr/share/fonts/Type1/courb.*      Yield:

-rw-r--r-- 1 root root  29815 Oct  5 17:45 /usr/share/fonts/Type1/courb.afm    
-rw-r--r-- 1 root root 126868 Oct  5 17:45 /usr/share/fonts/Type1/courb.pfa    

The Fontmap.GS points to a NimbusMonL-Bold font which.....
/Courier-Bold                   /NimbusMonL-Bold ;

btw. The Fontmap I mentioned stems from fontconfig: http://fontconfig.org/ 

Also take not that you cannot move around the Fontmap just like that. They may contain relative filespecs...
(as they would when refering to the current of subdirectories)

A tool to generate a Fontmap file for Ghostscript based on current ttf fonts....

The afm files (font metric files) can be generated from a type1 using: type1afm

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

  • 6
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now