Lacking Natural Simplicity

Random musings on books, code, and tabletop games.

install-font.sh - The simple approach

The simple approach to using install-font.sh to install fonts for groff probably works for almost everybody.

First, make sure that FontForge is installed; it is free and open source and available for installation in most distributions. Second, call the install-font.sh command with one argument, the font file, and answer the prompts.

This will install the fonts for groff's use in the appropriate directories under /usr/local/share/groff, creating the directories if necessary. If you need to install into /usr/share/groff you should specify the -s option to the script. For instance:

$ install-font.sh Lora-Regular.ttf

will install the Regular variant of the font, leading you through four prompts, for three of which you just need to take the default.

The only prompt where you need to do something other than accept the default is the prompt for the style. For Lora-Regular you'd specify +R. For italic, bold, and bold italic, the other traditional troff font styles, you'd specify +I, +B, and +BI. The prompt lists them all for you to choose from.

Here's a walk-through of installing the Lora font, assuming that install-font.sh is in your path. (If your /usr/local/share/groff directory isn't writable for your normal user, you should prefix the command with sudo.)

install-font.sh does produce a lot of output, but the colorizing helps pick out the important things. I've put the responses the user types in bold and red, and added “<RETURN>” where the user presses the RETURN key to accept defaults.

$ install-font.sh Lora-Regular.ttf
/usr/local/share/groff/site-font not found; creating.
/usr/local/share/groff/site-font/devps not found; creating.
/usr/local/share/groff/site-font/devpdf not found; creating.
Processing Lora-Regular.ttf...
Running fontforge...
Copyright (c) 2000-2020. See AUTHORS for Contributors.
 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
 with many parts BSD <http://fontforge.org/license.html>. Please read LICENSE.
 Version: 20201107
 Based on sources from 2020-11-16 19:11 UTC-D.
The following table(s) in the font have been ignored by FontForge
  Ignoring 'STAT' style attributes table
Done.
Family name (default = Lora): <RETURN>
  =>Lora-Regular (Lora-Regular.ttf) assigned to family 'Lora'.
Enter +STYLE (eg +R, +I, +B, +BI), or a unique groff name for Lora-Regular.
Leave blank to set name to 'Lora-Regular': +R
  =>Lora-Regular assigned groff fontname 'LoraR'.
Creating LoraR...
afmtodit: both uni00B5 and uni03BC map to mc at /Users/tkb/sw/versions/groff/git/bin/afmtodit line 6441.
Done.
Installing LoraR in /usr/local/share/groff/site-font/devps/... Done.
Make LoraR available to gropdf? (y/n; default = y) <RETURN>
Checking for gropdf executable and devpdf directory... gropdf found.
Installing LoraR in /usr/local/share/groff/site-font/devpdf/... Done.
Copy Lora-Regular.ttf to /usr/local/share/fonts/truetype/Lora/
  (y/n; default = n) <RETURN>
Install Lora-Regular.ttf manually to make it available system-wide.
$ install-font.sh Lora-Italic.ttf
Processing Lora-Italic.ttf...
Running fontforge...
Copyright (c) 2000-2020. See AUTHORS for Contributors.
 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
 with many parts BSD <http://fontforge.org/license.html>. Please read LICENSE.
 Version: 20201107
 Based on sources from 2020-11-16 19:11 UTC-D.
The following table(s) in the font have been ignored by FontForge
  Ignoring 'STAT' style attributes table
Done.
Family name (default = Lora): <RETURN>
  =>Lora-Italic (Lora-Italic.ttf) assigned to family 'Lora'.
Enter +STYLE (eg +R, +I, +B, +BI), or a unique groff name for Lora-Italic.
Leave blank to set name to 'Lora-Italic': +I
  =>Lora-Italic assigned groff fontname 'LoraI'.
Creating LoraI...
afmtodit: both uni00B5 and uni03BC map to mc at /Users/tkb/sw/versions/groff/git/bin/afmtodit line 6441.
Done.
Installing LoraI in /usr/local/share/groff/site-font/devps/... Done.
Make LoraI available to gropdf? (y/n; default = y) <RETURN>
Checking for gropdf executable and devpdf directory... gropdf found.
Installing LoraI in /usr/local/share/groff/site-font/devpdf/... Done.
Copy Lora-Italic.ttf to /usr/local/share/fonts/truetype/Lora/
  (y/n; default = n) <RETURN>
Install Lora-Italic.ttf manually to make it available system-wide.
$ install-font.sh Lora-Bold.ttf
Processing Lora-Bold.ttf...
Running fontforge...
Copyright (c) 2000-2020. See AUTHORS for Contributors.
 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
 with many parts BSD <http://fontforge.org/license.html>. Please read LICENSE.
 Version: 20201107
 Based on sources from 2020-11-16 19:11 UTC-D.
The following table(s) in the font have been ignored by FontForge
  Ignoring 'STAT' style attributes table
Glyph bounding box data exceeds font bounding box data for GID 4
  Subsequent errors will not be reported.
In GID 769 the advance width (1316) is greater than the stated maximum (1291)
  Subsequent errors will not be reported.
Done.
Family name (default = Lora): <RETURN>
  =>Lora-Bold (Lora-Bold.ttf) assigned to family 'Lora'.
Enter +STYLE (eg +R, +I, +B, +BI), or a unique groff name for Lora-Bold.
Leave blank to set name to 'Lora-Bold': +B
  =>Lora-Bold assigned groff fontname 'LoraB'.
Creating LoraB...
afmtodit: both uni00B5 and uni03BC map to mc at /Users/tkb/sw/versions/groff/git/bin/afmtodit line 6441.
Done.
Installing LoraB in /usr/local/share/groff/site-font/devps/... Done.
Make LoraB available to gropdf? (y/n; default = y) <RETURN>
Checking for gropdf executable and devpdf directory... gropdf found.
Installing LoraB in /usr/local/share/groff/site-font/devpdf/... Done.
Copy Lora-Bold.ttf to /usr/local/share/fonts/truetype/Lora/
  (y/n; default = n) <RETURN>
Install Lora-Bold.ttf manually to make it available system-wide.
$ install-font.sh Lora-BoldItalic.ttf
Processing Lora-BoldItalic.ttf...
Running fontforge...
Copyright (c) 2000-2020. See AUTHORS for Contributors.
 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
 with many parts BSD <http://fontforge.org/license.html>. Please read LICENSE.
 Version: 20201107
 Based on sources from 2020-11-16 19:11 UTC-D.
The following table(s) in the font have been ignored by FontForge
  Ignoring 'STAT' style attributes table
Glyph bounding box data exceeds font bounding box data for GID 4
  Subsequent errors will not be reported.
In GID 776 the advance width (1297) is greater than the stated maximum (1273)
  Subsequent errors will not be reported.
Done.
Family name (default = Lora): <RETURN>
  =>Lora-BoldItalic (Lora-BoldItalic.ttf) assigned to family 'Lora'.
Enter +STYLE (eg +R, +I, +B, +BI), or a unique groff name for Lora-BoldItalic.
Leave blank to set name to 'Lora-BoldItalic': +BI
  =>Lora-BoldItalic assigned groff fontname 'LoraBI'.
Creating LoraBI...
afmtodit: both uni00B5 and uni03BC map to mc at /Users/tkb/sw/versions/groff/git/bin/afmtodit line 6441.
Done.
Installing LoraBI in /usr/local/share/groff/site-font/devps/... Done.
Make LoraBI available to gropdf? (y/n; default = y) <RETURN>
Checking for gropdf executable and devpdf directory... gropdf found.
Installing LoraBI in /usr/local/share/groff/site-font/devpdf/... Done.
Copy Lora-BoldItalic.ttf to /usr/local/share/fonts/truetype/Lora/
  (y/n; default = n) <RETURN>
Install Lora-BoldItalic.ttf manually to make it available system-wide.

Last edited: 2021-07-20 12:40:30 EDT

Print Friendly and PDF

Comments

Comments powered by Disqus