Wiki
Clone wikiinstallfont / Home
installfont
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.
Documentation
Download
If you are interested in older version just use the 'Downloads' tab!
Dependencies
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 bytar -xf lcdf-typetools-w32.tar
and add the bin directory to the PATH.
You need to install Ghostscript if you are using TeXLive!
- Truetype
- *nix
- TeXLive
- Ghostscript (pf2afm)
- for installing fonts in other formats than Postscript Type1
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:
with the following meaning:
var | meaning | example |
---|---|---|
f | supplier (type foundry) | p (Adobe), l (Linotype), f (small foundries, free), ... |
xx | typeface | tm (Times), ch (Charter), hv (Helvetica), ... |
y(y) | weights/variants | r(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) |
zz | font encoding | 8a (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
Usage
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 opt | long opt | explanation |
---|---|---|
-f | --fontfamily | Name of the LaTeX font family, e.g. ptm (Adobe Times) |
-n | --fontname | Font name, e.g. Adobe Times |
-c | --fontcommand | Name of the command that will switch to the font |
-P | --fontscaleprefix | prefix of the scale macro, which should be different for each font (no digits allowed) |
-t | --fonttype | Font type (pst1(default)|ttf|otf) |
-p | --packagename | Name of the LaTeX package |
-d | --packagedate | Date of the LaTeX package |
-v | --packageversion | Version of the LaTeX package |
-l | --localtexmf | root of your local TeX tree, e.g. /cygdrive/c/LocalTeXMF (TeXLive version default: $TEXMFLOCAL) |
-s | --fontsubdir | location where the fonts and support files should be installed, e.g. MyFonts/AdobeTimes |
-e | --fontencoding | encoding of the font (default: 8a (AdobeStandardEncoding)) |
-o | --otffontfeatures | choosing Opentype font features (default: -fkern -fliga) |
-m | --mapfilename | file name of the map file (without .map) |
-u | --uninstall | will uninstall the font family. You must specify --localtexmf and --fontsubdir |
-R | --rmdefault | installs font family as roman (serif) font family (default) |
-S | --sfdefault | installs font family as sans serif font family |
-T | --ttdefault | installs font family as typewriter font family |
-O | --origfontname | use original font names instead of Karl Berry names |
-a | --admin | set administrative mode (MiKTeX v2.8+) |
-V | --version | will print the version number of the script |
-L | --log | will redirect the terminal output of the programms to the LOG file |
-h | --help | will 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%.
Updated