Plan 9 from Bell Labs’s /usr/web/sources/contrib/btdn/lib/cm/README

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


This should get you started to getting the Computer Modern typeface
to work with troff(1).

First, apply the (trivial) patches using ed(1).  The target files are:

	/sys/lib/troff/font/devutf/shell.lib
	/sys/src/cmd/postscript/buildtables/buildtables.sh
	/sys/src/cmd/postscript/trofftable/trofftable.sh

Run “mk all” to get the troff width files.  Once the file produced by
that step (the ones that do not end in .ps) are in
/sys/lib/troff/font/devutf, troff is satisfied.  To get aux/tr2post —
used by lp(1) — happy, you must make more files that live in
/sys/lib/postscript/troff.  Unfortunately, these cannot be
automagically generated for you and your author does not what would
optimally be in them, mk just steals a pre-existing one and makes a
change to it that will hopefully work.  That still leaves you with the
LucidaSans dependency, though.

But you are not done yet!  You have to figure out what fonts to
actually use.  You see, Knuth made lots of different variations.  As
he is Knuth, he also made variations on those variations.  The first
set of variation is what kind of font the font is (e.g., bold, italic,
and even more exotic beasts).  The second variation is based on size.
But you thought Type 1 fonts were scalable?  Well, they are!  Knuth
just decided to make the different variations look different at
different sizes.

To help you in your choosing from the first variation, a partial list
forcibly extracted from something apparently written by Knuth:

	cmr – Roman
	cms – Slanted
	cmdunh – Cmr but taller
	cmbx – Bold
	cmb – Cmbx but not extended
	cmbxsl – Cmbx slanted
	cmtt – Typewriter (fixed width)
	cmvtt – Typewriter (proportional)
	cmss – Sans serif
	cmsy – Math symbols
	cmex – “Math extension font” 
	cmtex – “Extended ASCII font”
	cmcsc – “Caps-and-small-caps font”
	cmtcsc – “Caps-and-small-caps font” (fixed width)

To figure out the second variation, ls(1) is your friend.  To find the
size optimisations avaliable for $variation:

	ls /sys/lib/postscript/font/cm/cm$variation*.pfa

An adventurous person may wish to make a post-processor for troff to
figure out the second variation.  If you do not feel like doing that,
you can always just use the font optimised for any particular size —
but then you would not be doing the Right Thing.

Proof(1) is happy enough to be useful, I suspect it does not really
care at all.

After immersing yourself in so much Knuth-ness, go read “Program
Design in the UNIX Environment” by Rob Pike and Brian Kernighan.

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.