0

I am trying to use the Palatino font with my groff mom document.

The documentation says

FAMILY takes one argument: the name of the family you want. Groff comes with a small set of basic families, each identified by a 1-, 2-or 3-letter mnemonic. The standard families are:
A = Avant Garde
BM = Bookman
H = Helvetica
HN = Helvetica Narrow
N = New Century Schoolbook
P = Palatino
T = Times Roman
ZCM = Zapf Chancery
The argument you pass to FAMILY is the identifier at left, above. For example, if you want Helvetica, enter
.FAMILY H

I assume then that I can use the Palatino font with .FAMILY P. However, when I do this I get these warnings, and the compiled PDF uses a fallback monospace font:

report.mom:28: warning: can't find font `PR'
report.mom:31: warning: can't find font `PB'
report.mom:31: warning: can't find font `PI'
report.mom:31: warning: can't find font `PBI'
[mom]: Either font style "B" at line 31 does not exist in family "P",
       or family "P" has not been installed.
Aborting 'report.mom' at FT, line 31.

I am compiling like this:

pdfmom -t report.mom > report.pdf

I have groff version 1.22.3 installed.

My interpretation of "Groff comes with a small set of basic families" is that all of the standard families are available in the default installation of groff.

Am I mistaken? Is there a manual step I need to take to install or configure Palatino for use by groff?

Edit

Looking more closely on my system:

$ ls /usr/share/groff/1.22.3/font/devpdf
CB   CI  DESC      enc   Foundry  HBI  HR   S   TBI  TR    ZD
CBI  CR  download  EURO  HB       HI   map  TB  TI   util
$ ls /usr/share/groff/1.22.3/font/devps
AB   BMB   CB   DESC          freeeuro.pfa  HI    HNR  NI   PI        SS            text.enc    ZCMI
ABI  BMBI  CBI  download      generate      HNB   HR   NR   PR        symbolsl.pfa  TI          ZD
AI   BMI   CI   EURO          HB            HNBI  NB   PB   prologue  TB            TR          ZDR
AR   BMR   CR   freeeuro.afm  HBI           HNI   NBI  PBI  S         TBI           zapfdr.pfa

So it appears I have Palantino available for the ps device (because of the P* files in font/devps) but not for the pdf device.

I tried to just copy the P* files from font/devps to font/devpdf and recompile, but then the text had weird spacing issues after. There are no spacing issues if I compile with -Tps.

How can I correctly configure my system to allow me to use the Palantino font with the pdf device?

5
  • The needed file may be in a separate package. Eg on my old Fedora system, the file /usr/share/groff/1.22.3/font/devpdf/PBI is in package groff-perl, whereas groff-base contains all the .../devps/ metrics files.
    – meuh
    Jan 22, 2021 at 18:14
  • @meuh I'm on Ubuntu, and there doesn't appear to be a groff-perl apt package, unless its part of a PPA I don't have. I have both the groff and groff-base apt packages installed (both are version 1.22.3). Jan 22, 2021 at 18:17
  • Copying the font metrics is enough to create the pdf but to view it you also need the actual Palatino font available to the pdf viewer. As it is probably copyright and non-free it might not be available on Unix systems.
    – meuh
    Jan 22, 2021 at 19:35
  • I'm using evince as my PDF viewer. When I compile to PostScript with groff -mom -Tps -t report.mom > report.ps and view the PS file in evince, the text doesn't have any spacing issues. When I copy the P* files to font/devpdf and compile to PDF with pdfmom -t report.mom > report.pdf, then the text has spacing issues in PDF. So I believe just copying the font/devps/P* files to font/devpdf is not the right solution. Jan 22, 2021 at 19:56
  • @ShaneBishop That's strange the Palatino font's not there. I've got it with Groff 1.22.4 on Debian in font/devpdf. Try upgrading Groff? Jun 5, 2021 at 15:30

1 Answer 1

0

What you can do is use the regular Troff .fam argument, then P. I've had pretty good success with that.

The other thing you can try is using Troff by itself and then the Postprocessor Gropdf to render like this.

troff -mom -Tpdf $INPUTFILE | gropdf $INPUTFILE > $OUTPUTFILE

(replace $INPUTFILE with your File name and $OUTPUTFILE with what you want the PDF called)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.