How to convert TrueType? fonts (and PostScript? fonts) for use with groff. I tried this with Verdana and it did the job. Next up, the (more complex) open-source Bitstream Vera family (or the more complete DejaVu family... which we should consider adding to the groff distribution).
- Convert the TrueType? family to ASCII (.pfa) PostScript?.
- (start here for fonts that are already PostScript?) Create AFM (font metric) files using printafm (a GhostScript? utility). For each typeface:
printafm font-roman.pfa >font-roman.afm
- Copy the text map from .../font/devps/generate/textmap into your directory.
- For each typeface, create the groff metric files (XR is the name of the typeface as groff sees it, such as "TR" for Times-Roman):
afmtodit font-roman.afm my-textmap XR
- If necessary, edit the groff metric files so that the "internalname" matches the /FontName of the associated font:
name XB
internalname Xfont-Bold
- Copy the .pfa files and the groff metric files to /usr/share/groff/site-font/devps (or the site-font directory where groff is installed -- make a site-font directory if it's not there).
- Build a download file using the following awk script:
#! /usr/bin/awk -f
#
# Usage: grep FontName? *.pfa | awk -f mkdownload.awk >download
BEGIN {
OFS = '\t';
print "# downloadable fonts";
print "#";
print "# PostScript? name", "File name";
print "#";
}
{
sub( /:\/FontName/, "", $1 );
sub( /\//, "", $2 );
print $2, $1;
}
- Copy the download file to .../site-font/devps/download
- Try it out!
See also: AddingFonts
Back to: GroffTips
Edit ConvertingTrueTypeFonts
FrontPage
PageList
RecentChanges
PageHistory