Clone wiki

installfont / Home


Welcome on the project page of installfont

With this script you can install a LaTeX font family (PostScript Type 1, TrueType and OpenType formats are supported). Font series from light to ultra bold, and (faked) small caps and (faked) slanted shapes are supported, but not expert fonts.

The script will rename the fonts automatically (optional) or will otherwise expect the *.afm files and the font files (in PostScript Type1 format) named in the Karl Berry scheme (e.g. 5bbr8a.pfb). After running the script, you should have a working font installation in your local TeX tree.




If you are interested in older version just use the 'Downloads' tab!


For using this script the following programms have to be installed:

  • Windows
    • MiKTex or TeXLive
    • cygwin or any other *nix-like environment with the same functionality
      Download setup.exe and follow the instructions on the cygwin homepage
    • for installing fonts in other formats than Postscript Type1
      • Truetype
        Download the ttf2pt1 Installer , install ttf2pt1 and add the installation directory to your PATH
      • Opentype
        Download the LCDF Typetools and run (bash/cygwin): unxz lcdf-typetools-w32.tar.xz followed by tar -xf lcdf-typetools-w32.tar and add the bin directory to the PATH.
        You need to install Ghostscript if you are using TeXLive!
  • *nix
    • TeXLive
    • Ghostscript (pf2afm)
    • for installing fonts in other formats than Postscript Type1
      • Truetype
        Install the ttf2pt1 package with your distribution package manager or download a package from a webpage.
      • Opentype
        Install the lcdf-typetools package with your distribution package manager or download a package from a webpage.

You can also convert the font manually, e.g. with Fontforge. Load the font, reencode the font to 'Adobe Standard' and generate the font (PS Type1 (Binary)). There's a pre-built package for cygwin!

The font(s)

The core part of the script needs the font(s) in Postscript Type1 format and named in Karl Berry scheme. It can try to convert and to rename the font(s) and afm files for you by analyzing the afm files. If it fails, you will have to rename the font(s) and afm files on your own. The Karl Berry scheme expects a file to be named like this:

karl berry scheme

with the following meaning:

fsupplier (type foundry)p (Adobe), l (Linotype), f (small foundries, free), ...
xxtypefacetm (Times), ch (Charter), hv (Helvetica), ...
y(y)weights/variantsr(regular/medium), ri(regular/medium italic), rc(regular/medium small caps), b(bold), bi(bold italic), bc(bold small caps), l(light), li(light italic), lc(light small caps), s(semi bold), si(semi bold italic), sc(semi bold small caps), d(demi), di(demi italic), dc(demi small caps), x(extra bold), xi(extra bold italic), xc(extra bold small caps), u(ultra bold/heavy), ui(ultra bold/heavy italic), uc(ultra bold/heavy small caps)
zzfont encoding8a (AdobeStandardEncoding), 8r (TeX base encoding), ...

The script supports the cuts presented in the table. Don't copy more than these cuts into your working directory, otherwise the automatic renaming will quite likely fail! It will add faked slanted cuts and faked small caps, if there are no real small caps fonts. If you only have one font cut, it will be installed as regular font. If you want more information about Karl Berry scheme read:

texdoc fontname


To install a font family simply call the script:

kleberj@home ~/installfontdir
$ installfont -f 5na -n 'Softmaker Nashville' -c Nashville -P MF@Sna -v v1.0 -l /cygdrive/d/LocalTeXMF -s MyFonts/Nashville -p nashville -m nashville -O -d 2010/09/14

You can also put a copy of the script in your working directory and change the default values of the script variables. Then you can simply call the script with

kleberj@home ~/installfontdir
$ ./installfont

After running the script the font(s) should be properly installed. You can use the font just with \usepackage{PACKAGENAME} or \FONTCOMMAND.

The script offers the following command line options:

short optlong optexplanation
-f--fontfamilyName of the LaTeX font family, e.g. ptm (Adobe Times)
-n--fontnameFont name, e.g. Adobe Times
-c--fontcommandName of the command that will switch to the font
-P--fontscaleprefixprefix of the scale macro, which should be different for each font (no digits allowed)
-t--fonttypeFont type (pst1(default)|ttf|otf)
-p--packagenameName of the LaTeX package
-d--packagedateDate of the LaTeX package
-v--packageversionVersion of the LaTeX package
-l--localtexmfroot of your local TeX tree, e.g. /cygdrive/c/LocalTeXMF (TeXLive version default: $TEXMFLOCAL)
-s--fontsubdirlocation where the fonts and support files should be installed, e.g. MyFonts/AdobeTimes
-e--fontencodingencoding of the font (default: 8a (AdobeStandardEncoding))
-o--otffontfeatureschoosing Opentype font features (default: -fkern -fliga)
-m--mapfilenamefile name of the map file (without .map)
-u--uninstallwill uninstall the font family. You must specify --localtexmf and --fontsubdir
-R--rmdefaultinstalls font family as roman (serif) font family (default)
-S--sfdefaultinstalls font family as sans serif font family
-T--ttdefaultinstalls font family as typewriter font family
-O--origfontnameuse original font names instead of Karl Berry names
-a--adminset administrative mode (MiKTeX v2.8+)
-V--versionwill print the version number of the script
-L--logwill redirect the terminal output of the programms to the LOG file
-h--helpwill print this help statement

LaTeX package options

The style file created with this script offers the following options:

  • scaled
    You can use the option scaled for scaling the font to better match with other fonts.
  • leading
    For some fonts it might be necessary to increase the leading between lines for a better optical impression, where 1.0 means 100%.