Greg
How to set up groff fonts
Greg's home page
Greg's diary
Greg's photos
Greg's links
Google

Using fonts in groff

This document has not yet been completed. The information below is meaningful, but you'll have to guess the meaning.

Overhead slides

I use groff to prepare overhead slides. It's not 100% straightforward: for one thing, there's no paper format that matches overhead projectors, which still almost always have a 4:3 format. I fix this one by defining my own. Here's a patch which might need a little massaging.
# Slides require the following patch to describe the format:
#
# --- /usr/local/share/ghostscript/6.51/lib/gs_statd.ps   Sat Oct 20 18:58:39 2001
# +++ /wantadilla/usr/local/share/ghostscript/6.01/lib/gs_statd.ps        Sun Dec 31 16:45:44 2000
# @@ -40,6 +39,7 @@
#  /.setpagesize { /statusdict .systemvar begin .setpagesize end } bind def
#  userdict begin
#                 % Page sizes defined by Adobe documentation
# + /vga4x3 {480 360 //.setpagesize exec} bind def  % output on standard VGA screen (4x3)
#   /11x17 {792 1224 //.setpagesize exec} bind def  % 11x17 portrait
#   /a3 {842 1190 //.setpagesize exec} bind def
#   /a4 {595 842 //.setpagesize exec} bind def
# @@ -124,7 +124,7 @@
#   { /letter /note /legal
#     /a0 /a1 /a2 /a3 /a4 /a5 /a6 /a7 /a8 /a9 /a10
#     /b0 /b1 /b2 /b3 /b4 /b5 /b6 /archE /archD /archC /archB /archA
# -   /flsa /flse /halfletter /11x17 /ledger
# +   /flsa /flse /halfletter /vga4x3 /11x17 /ledger
#   } cvlit readonly def
#
#  %%%%%% The following items were suggested by a user as useful.

With this patch, the “paper” has dimensions of 4" x 3".

=== grog@wantadilla (/dev/ttypb) /src/BLFS/Rocksoft/Documentation 149 -> remake howto-clean-up.ps
pic /home/Book/tools/tmac.G howto-clean-up.G | tbl | groff -rN2 -rL12i -rO60p -rW6.5i -Tps >howto-clean-up.ps 2>howto-clean-up.toc  || cat howto-clean-up.toc
emacs -batch howto-clean-up.ps -l /home/grog/letters/setoffset.el
Saving file /src/BLFS/Rocksoft/Documentation/howto-clean-up.ps...
Wrote /src/BLFS/Rocksoft/Documentation/howto-clean-up.ps

11 pages
=== grog@wantadilla (/dev/ttypb) /src/BLFS/Rocksoft/Documentation 150 -> remake howto-clean-up.pdf
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sPAPERSIZE=a4 -sOutputFile=howto-clean-up.pdf -c save pop -f howto-clean-up.ps

Saturday, 3 July 2004

Back to working on AUUGN today, in the process debugging some macros and working out an automatic way to build the download file that groff uses to decide which fonts to include in a PostScript document. In FreeBSD, the file is called /usr/share/groff_font/devps/download, and it contains a lookup from font name to the file which contains the description:
# List of downloadable fonts
# PostScript-name   Filename

Symbol-Slanted              symbolsl.pfa
ZapfDingbats-Reverse        zapfdr.pfa
The second entry on each line is the name of a file in the same directory. They start with a line like: %!PS-AdobeFont-1.0: Garamond-Bold 001.003, which gives the information needed for download. The following single line script adds to it:
$ grep AdobeFont *.pfa | sed 's/:.*://'|awk '{print $2 "\t" $1}' >> download
Without this download file, documents will be encoded without fonts; that will only work if the same fonts are available when the document is displayed. Very frequently you'll see PDF documents with incorrect spacing round the ligatures ff, fi, ffi and ffl. Setting up the download file should fix that.


Greg's diary Greg's photos Greg's links Greg's home page
Valid XHTML 1.0! $Id: groff-fonts.html,v 1.4 2005/12/29 23:51:42 grog Exp $