AUTOINST(1) | Marc Penninga | AUTOINST(1) |
autoinst - wrapper around the LCDF TypeTools, for installing and using OpenType fonts in LaTeX.
autoinst -help
autoinst [options] font(s)
Eddie Kohler's LCDF TypeTools are superb tools for installing OpenType fonts in LaTeX, but they can be hard to use: they need many, often long, command lines and don't generate the fd and sty files LaTeX needs. autoinst simplifies the use of the TypeTools for font installation by generating and executing all commands for otftotfm, and by creating and installing all necessary fd and sty files.
Given a family of font files (in otf or ttf format), autoinst will create several LaTeX font families:
Of course, if your fonts don't contain italics, oldstyle digits, small caps etc., the corresponding shapes and families are not created. In addition, the creation of most families and shapes can be controlled by the user (see "COMMAND-LINE OPTIONS" below).
These families use the FontPro project's naming scheme: <FontFamily>-<Suffix>, where <Suffix> is:
The individual fonts are named <FontName>-<suffix>-<shape>-<enc>, where <suffix> is the same as above (but in lowercase), <shape> is either empty, "sc" or "swash", and <enc> is the encoding (also in lowercase). A typical name in this scheme would be FiraSans-Light-osf-sc-ly1.
autoinst generates a style file for using the fonts in LaTeX documents, named <FontFamily>.sty. This style file also loads the fontenc and textcomp packages, if necessary. To use the fonts, add the command "\usepackage{<FontFamily>}" to the preamble of your document.
This style file has a few options:
The last two groups of options will only work if you have the mweights package installed. The default here is not to change LaTeX's default, i.e. use the "m" and "b" weights.
The style file will also try to load the fontaxes package (on CTAN), which gives easy access to various font shapes and styles. Using the machinery set up by fontaxes, the generated style file defines a number of commands (which take the text to be typeset as argument) and declarations (which don't take arguments, but affect all text up to the end of the current group) to access titling, superior and inferior characters:
DECLARATION COMMAND SHORT FORM OF COMMAND \tlshape \texttitling \texttl \supfigures \textsuperior \textsup, \textsu \inffigures \textinferior \textinf, \textin
In addition, the existing "\swshape" and "\textsw" commands are redefined to place swash on fontaxes' secondary shape axis (fontaxes places it on the primary shape axis) to make them behave properly when nested, so that "\swshape\upshape" will give upright swash.
There are no commands for accessing the numerator and denominator fonts; these can be selected using fontaxes' standard commands, e.g., "\fontfigurestyle{numerator}\selectfont".
These commands are only generated for existing shapes and number styles; no commands are generated for shapes and styles that are missing from your fonts. Also these commands are built on top of fontaxes, so if that package cannot be found, you're limited to using the lower-level commands from standard NFSS ("\fontfamily", "\fontseries", "\fontshape" etc.).
By default, autoinst generates text fonts with OT1, LY1 and T1 encodings, and the generated style files use T1 as the default text encoding. Other encodings can be chosen using the -encoding option (see "COMMAND-LINE OPTIONS" below).
This is an experimental feature; USE AT YOUR OWN RISK! Test the results thoroughly before using them in real documents, and be warned that future versions of autoinst may introduce incompatible changes.
The -math option tells autoinst to generate basic math fonts. When enabled, the generated style file defines a few extra options to access these math fonts:
Note that this "math" option only affects digits, latin and greek letters, plus a few basic punctuation characters; all other mathematical symbols, operators, delimiters etc. are left as they were before. If you don't want to use TeX's default versions of those symbols, load another math package (such as mathdesign or newtxmath) before loading the autoinst-generated style file.
Finally, note that autoinst doesn't check if your fonts actually contains all of the required characters; it just assumes that they do and sets up the style file accordingly. Even if your fonts contain greek, characters such as "\varepsilon" may be missing. You may also find that some glyphs are present in your fonts, but don't work well in equations or don't match with other symbols; edit the generated style file to remove the declarations of these offending characters. Once again: test the results before using them! If the characters themselves are fine but spaced too tightly, you may try increasing the side bearings in math fonts with the -mathspacing option (see below), e.g. "-mathspacing=50".
LaTeX's New Font Selection System (NFSS) identifies fonts by a combination of family, series (the concatenation of weight and width), shape and size. autoinst parses the font's metadata to determine these parameters. When this fails (usually because the font family contains uncommon weights, widths or shapes), autoinst ends up with multiple fonts having the same values for these font parameters; such fonts cannot be used in NFSS, since there's no way distinguish them. When autoinst detects such a situation, it will print an error message and abort. If that happens, either rerun autoinst on a smaller set of fonts, or add the missing widths, weights and shapes to the tables @WIDTH, @WEIGHT and %SHAPE in the source code. Please also send a bug report (see AUTHOR below).
The mapping of shapes to NFSS codes is done using the following table:
SHAPE CODE -------------------------------- ---- Roman, Upright n Italic it Oblique, Slant(ed), Incline(d) sl
(Exception: Adobe Silentium Pro contains two Roman shapes; we map the first of these to "n", for the second one we (ab)use the "it" code as this family doesn't contain an Italic shape.)
For weights and widths, autoinst tries to the standard NFSS codes (ul, el, l, sl, m, sb, b, eb and ub for weights; uc, ec, c, sc, m, sx, x, ex and ux for widths) as much as possible. Of course, not all 81 combinations of these NFSS weights and widths will map to existing fonts; and conversely it may not be possible to assign every existing font a unique code in a sane way (especially for the weights, some font families offer more variants than NFSS's codes can handle; e.g., Fira Sans contains fifteen different weights!). Therefore every font is also assigned a "series" name that is the concatenation of its weight and width, after expanding any abbreviations and converting to lowercase. A font of "Cond" width and "Ultra" weight will then be known as "ultrablackcondensed".
The exact mapping between fonts and NFSS codes can be found in the generated fd files and in the log file (you may want to run autoinst with the -dryrun option to check the chosen mapping beforehand). The -nfssweight and -nfsswidth command-line options can be used to finetune the mapping between NFSS codes and fonts.
To access specific weights or widths, one can always use the "\fontseries" command with the full series name (i.e., "\fontseries{demibold}\selectfont").
Ornament fonts are regular LY1-encoded fonts, with a number of "regular" characters replaced by ornament glyphs. The OpenType specification says that fonts should only put their ornaments in place of the lowercase ASCII letters, but some fonts put them in other positions (such as those of the digits) as well.
Ornaments can be accessed like "{\ornaments a}" and "{\ornaments\char"61}", or equivalently "\textornaments{a}" and "\textornaments{\char"61}". To see which ornaments a font contains (and at which positions), run LaTeX on the file nfssfont.tex (which is included in any standard LaTeX installation), supply the name of the ornament font (i.e., "GaramondLibre-Regular-orn-u") and give the command "\table\bye"; this will create a table of all glyphs in that font.
Note that versions of autoinst up to 20200428 handled ornaments differently, and fonts and style files generated by those versions are not compatible with files generated by newer versions.
Since pdfTeX cannot subset otf-flavoured OpenType fonts, otftotfm will convert such fonts to Type1 (pfb) format. However, many fonts (at least those licensed under the SIL Open Font License) do not allow distributing such converted versions under their original name.
To meet these licensing requirements, autoinst provides a -t1suffix command-line option that appends a user-defined suffix to the names (both the filename and the internal font name) of all generated Type1 fonts; see "COMMAND-LINE OPTIONS" below.
The LIGTABLE in TeX's tfm files, which contains a font's ligatures and kerning pairs, is limited to about 32,500 entries (2^15 - 256). If the number of ligatures plus kerns in a font is higher than that limit, pltotf and vptovf will complain loudly and ignore the excess entries. This happens at least with Adobe's Source Serif 4 and Minion 3. The best way to handle this situation is to use autoinst's "-extra" option to raise otftotfm's value for the "--min-kern" parameter, which causes it to ignore small kerning pairs: "-extra='--min-kern=5.0'".
Automatically installing the fonts into a suitable TEXMF tree (as autoinst tries to do by default) only works for TeX-installations that use the kpathsea library; with TeX distributions that implement their own directory searching, such as MiKTeX, autoinst will complain that it cannot find the kpsewhich program and move all generated files into a subdirectory "autoinst_output/" of the current directory. If you use such a TeX distribution, you should either move these files to their correct destinations by hand, or use the -target option (see "COMMAND-LINE OPTIONS" below) to manually specify a TEXMF tree.
Also, some OpenType fonts contain so many kerning pairs that the resulting pl and vpl files are too big for MiKTeX's pltotf and vptovf; the versions that come with W32TeX (http://www.w32tex.org) and TeXLive (http://tug.org/texlive) don't seem to have this problem.
By default, autoinst will try to install all generated files into the $TEXMFLOCAL tree; when this directory isn't user-writable, it will use the $TEXMFHOME tree instead. Unfortunately, MacTeX's version of "updmap-sys" doesn't search in $TEXMFHOME, and hence MacTeX will not find the new fonts.
To remedy this, either run autoinst as root (so that it can install everything into $TEXMFLOCAL) or manually run "updmap -user" to tell TeX about the files in $TEXMFHOME. This latter option does, however, come with some caveats; see https://tug.org/texlive/scripts-sys-user.html.
autoinst tries hard to do The Right Thing (TM) by default, so you usually won't need these options; but most aspects of its operation can be fine-tuned if you want to.
You may use either one or two dashes before options, and option names may be shortened to a unique prefix (e.g., -encoding may be abbreviated to -enc or even -en, but -e is ambiguous (it may mean either -encoding or -extra)).
For each encoding argument, autoinst will first check if it is the filename of an encoding file, and if found it will use that; otherwise the argument is assumed to be the name of one of the built-in encodings. Currently autoinst comes with built-in support for the OT1, T1/TS1, LY1, LGR, T2A/B/C and T3/TS3 encodings. (These files are called fontools_ot1.enc etc. to avoid name clashes with other packages; the fontools_ prefix may be omitted.)
If you specify a style of inferiors that isn't present in the font, autoinst will fall back to its default behaviour of not creating fonts with inferiors at all; it won't try to substitute one of the other styles.
Specify -noligatures to disable generation of ligatures even for fonts that do contain a "liga" feature.
Installing the font as a typewriter font will cause two further changes: it will - by default - turn off the use of f-ligatures (though this can be overridden with the -ligatures option), and it will disable hyphenation for this font. This latter effect cannot be re-enabled in autoinst; if you want typewriter text to be hyphenated, use the hyphenat package.
If none of these options is specified, autoinst tries to guess: if the font's filename contains the string "mono" or if the field "isFixedPitch" in the font's "post" table is True, it will select -typewriter; else if the filename contains "sans" it will select -sanserif; otherwise it will opt for -serif.
See also "OpenType fonts and licensing issues" in "WARNINGS AND CAVEATS" above.
By default, autoinst searches the $TEXMFLOCAL and $TEXMFHOME trees and installs all files into the first user-writable TEXMF tree it finds. If autoinst cannot find such a user-writable directory (which shouldn't happen, since $TEXMFHOME is supposed to be user-writable) it will print a warning message and put all files into the subdirectory "autoinst_output/" of the current directory. It's then up to the user to move the generated files to a better location and update all relevant databases (usually by calling texhash and updmap).
Don't use these options unless you are certain you need them! They are only needed for fonts that don't provide OpenType features for their default figure style; and even in that case, autoinst's default values (-defaultlining and -defaulttabular) are usually correct.
Eddie Kohler's TypeTools and T1Utils (http://www.lcdf.org/type).
Perl can be obtained from http://www.perl.org; it is included in most Linux distributions. For Windows, try ActivePerl (http://www.activestate.com) or Strawberry Perl (http://strawberryperl.com).
LuaTeX (http://www.luatex.org) and XeTeX (http://www.tug.org/xetex) are Unicode-aware TeX engines that can use OpenType fonts directly, without any (La)TeX-specific support files.
The FontPro project (https://github.com/sebschub/FontPro) offers very complete LaTeX support (even for typesetting maths) for Adobe's Minion Pro, Myriad Pro and Cronos Pro font families.
Marc Penninga (marcpenninga@gmail.com)
When sending a bug report, please give as much relevant information as possible; this usually includes (but may not be limited to) the log file (please add the -verbose command-line option, for extra info). If you see any error messages, please include these verbatim; don't paraphase.
Copyright (C) 2005-2022 Marc Penninga.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. A copy of the text of the GNU General Public License is included in the fontools distribution; see the file GPLv2.txt.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
This document describes autoinst version 20220124.
(See the source for the full story, all the way back to 2005.)
2022-01-24 | fontools |