[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Fwd: Would it be reasonable to list the fonts that are available by
G. Branden Robinson
Re: Fwd: Would it be reasonable to list the fonts that are available by default in groff?
Sun, 18 Jul 2021 09:02:33 +1000
At 2021-07-17T01:55:02-0400, T. Kurt Bond wrote:
> Yes, "sudo install-font.sh <fontfile>" is simpler, as long as you know
> how to answer the prompts! I should have started there in my
> explanation. I guess the fact that I run the script potentially
> multiple times on multiple different computers makes my usage more
> I'll have to read the source of the script again and look at how it
> finds where the site-font directory is, and try running it the simpler
> way and write something up about that.
I'm beginning to remember why I have shied away from picking up this
task, in spite of the glory that would redound to me...
GNU/Linux distributions generally aren't going to require the
interactivity features; what a package manager needs is a script that
can be handed enough information via command-line arguments to do its
business when called from a package trigger or post-installation script.
To support end users, we'll also want to support installation of fonts
to someplace in a user's $HOME, and teach them to update (more likely,
set) their GROFF_FONT_PATH to look for fonts there.
I tried to cover this in an update to grops(1) I made last October, but
I haven't gotten any feedback on it.
Author: G. Branden Robinson <firstname.lastname@example.org>
Date: Sat Oct 17 10:07:47 2020 +1100
grops(1): Improve TrueType font discussion.
* src/devices/grops/grops.1.man (Usage/TrueType and other font formats):
Remove dead URL to ttftot42 utility. Update URL to fontforge tool.
Replace much of the discussion with an example, motivated by Jordan
Torbiak's "groff-install-font" script on GitHub Gist, of how to add
the Roboto Slab Regular font to a user-local groff font directory (and
how to test it, too).
See https://gist.github.com/torbiak/3352fe1f559dbfbf99d6f5704adf442e for
Here's the chunk I added to the man page.
TrueType and other font formats
TrueType fonts can be used with grops if converted first to Type 42
format, a PostScript wrapper equivalent to the PFA format described in
pfbtops(1). Several methods exist to generate a Type 42 wrapper; some
of them involve the use of a PostScript interpreter such as Ghost‐
One approach is to use FontForge ⟨https://fontforge.org/⟩, a font edi‐
tor that can convert most outline font formats. Here’s an example of
using the Roboto Slab Serif font with groff. Several variables are
used so that you can more easily adapt it into your own script.
mkdir -p "$DIR"/devps
fontforge -lang=ff -c "Open(\"$TTF\");\
afmtodit "$DIR/devps/$AFM" "$MAP" "$DIR/devps/$GFN"
printf "$BASE\t$PFA\n" >> "$DIR/devps/download"
fontforge and afmtodit may generate warnings depending on the attrib‐
utes of the font. The test procedure is simple.
printf ".ft RSR\nHello, world!\n" | groff -F "$DIR" > hello.ps
Once you’re satisifed that the font works, you may want to generate any
available related styles (for instance, Roboto Slab also has “Bold”,
“Light”, and “Thin” styles) and set up GROFF_FONT_PATH in your environ‐
ment to include the directory you keep the generated fonts in so that
you don’t have to use the -F option.
I realize that remains more work than we can expect most people to do.
Description: PGP signature
Re: Would it be reasonable to list the fonts that are available by default in groff?, Douglas McIlroy, 2021/07/15
Re: Would it be reasonable to list the fonts that are available by default in groff?, Douglas McIlroy, 2021/07/16
Re: Would it be reasonable to list the fonts that are available by default in groff?, G. Branden Robinson, 2021/07/17