Skip to main content

Adding Fonts to enscript

Installing new fonts for use with enscript on OS-X

We'll store the new fonts in a personal directory, e.g., ~/.fonts.

For TTF Fonts

  1. Find one or more ttf fonts you wish to install. Let's assume Consolas.ttf. Copy the file to ~/.fonts.

  2. Convert the ttf to afm:

    $ cd ~/.fonts
    
    # Can't seem to stack flags with ttf2pt1.
    # Do them one at a time.
    $ ttf2pt1 -e Consolas.ttf
    $ ttf2pt1 -a Consolas.ttf
    $ ttf2pt1 -b Consolas.ttf
    
    # Confirm the ttf was converted
    $ ls -1
    Consolas.afm
    Consolas.pfa
    Consolas.pfb
    Consolas.t1a
    Consolas.ttf
    
  1. Create a font.map for your fonts directory. Obviously, you can have multiple fonts in there, but this example just has Consolas.

    $ mkafmmap *.afm
    
  2. Edit your .enscriptrc to include your fonts directory in the AFMPath. Mine ended up looking like this:

    AFMPath: /opt/local/share/enscript/afm:/usr/local/lib/ps:/usr/lib/ps:/Users/khe/.fonts
    

    The extra path information in AFMPath was taken from /opt/local/etc/enscript.cfg.