groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Computer Modern Font


From: Alexis
Subject: Re: Computer Modern Font
Date: Wed, 7 Jun 2023 18:22:43 +0200

Hello Damian,

I've been meaning to use Computer Modern with groff for quite some time.
Your message motivated me to find a semi-automated way to do that.
Thanks!

Please find attached a Makefile that downloads a specified release
(currently 0.7.0) of the Computer Modern Unicode font sources from

  https://sourceforge.net/projects/cm-unicode/files/

and generates the font files for use with groff along with some
helpful font name aliases.
I find the original font names are named in a way that makes them
hard to use, e.g. what font is provided by cmunst?
Whereas their internal font name is much more explicit, e.g.
CMUTypewriterOblique.¹

To use the Makefile, place it in a directory you feel comfortable to
include in GROFF_FONT_PATH and run:

  % make download
  % make fonts  # Needs to be two separate commands for now

The Makefile requires common command-line utilities like grep, sed, awk
etc. to be available and an installation of groff providing afmtodit.

> What is the best way to use them?
One very good way I found to use the Computer Modern font in my groff
documents without needing to worry much about the details of setting the
font is using the attached cmu.tmac macro package which substitutes
groff's commonly used font styles (R, B, I, C, CI, etc.) with
an equivalent from Computer Modern Unicode.

To use cmu.tmac, place it in a directory you feel comfortable to
include IN GROFF_TMAC_PATH and include the cmu macro package, either
via the commandline, i.e. `-mcmu` or from within your document via
`.mso cmu.tmac`.

As an example the following command produces the documentation
for the ms macro package using Computer Modern Unicode:

  % groff -Tpdf -t -ms -mcmu doc/ms.ms > doc/ms.pdf


Hope this helps
Alexis


¹ For those wondering: The Makefile deletes hyphens from the font names
as groff did not properly show the fonts that contained a hyphen
in their name.

Attachment: Makefile
Description: Text document

Attachment: cmu.tmac
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]