How to configure groff to use a font
The font metrics has to be specified for each output device.
- font names are from /usr/share/ghostscript/8.15/lib/Fontmap.GS
- for some fonts prepend / to the name (/DejaVu Serif)
- font name is valid if printafm Name | head has FullName=Name
- do not use ttf2afm, it does not work with afmtodit
Fonts seem required to have a iso8859 encoding (to check: xfontsel).
devps
cd /usr/share/groff/current/font/devps
add to ./generate/textmap: quotesingle '
printafm Times | afmtodit - ./generate/textmap TR
printafm Times-Italic | afmtodit - ./generate/textmap TI
printafm Times-Bold | afmtodit - ./generate/textmap TB
printafm Times-BoldItalic | afmtodit - ./generate/textmap TBI
To check,
with check.tr:
groff -Tps check.tr | ghostview -nocenter -
devX*
Same as devps, but:
- use textmap from devps
- change unitwidth to 10 in DESC, after printafm... change to 8
- modify fonts in app-defaults/GXditview
To check, still
with check.tr:
groff -TX100 check.tr
Embed fonts in postscript
Example for TR:
- determine postscript name from devps/TR; it is the name that follows
internalname, in this case Times-Roman
- determine file of postscript font in Fontmap.GS, in this case
Times-Roman is NimbusRomNo9L-Regu,
which in turn is n021003l.pfb
- in devps: pfbtopfa /usr/share/ghostscript/fonts/n021003l.pfb
- break lines longer than 255 if any, like /Notice
- for lines made of a continous string of characters:
s,.\{80\},&\r,g
- add to devps/download: Times-Roman n021003l.pfa