Table of Contents

Name

otftotfm - create TeX font metrics from PostScript OpenType fonts

Synopsis

otftotfm [-a] [options] fontfile.otf [texname]

Description

Otftotfm creates the font metric and encoding files required to use an OpenType font with TeX. You supply an OpenType ".otf" font file, a base ".enc" encoding, and a TeX name "texname" for the resulting font, and say which OpenType features should be turned on. Then otftotfm generates and installs the corresponding TeX-related metric files (".tfm" TeX font metrics, ".vf" virtual fonts, and ".enc" encoding files). It only works on PostScript-flavored OpenType fonts.

The easiest way to use otftotfm is with the -a option; see Automatic Mode below. Without -a, otftotfm writes all its output files to the current directory.

After running "otftotfm fontfile.otf texname" and installing the results (manually or with -a), you can use the OpenType font in plain TeX with a command like this:


    \font\myfont=texname at 10pt
    {\myfont This text uses the OpenType font.}

LaTeX users will generally make a ".fd" input file so that commands like "\renewcommand{\rmdefault}{TeXName}" work correctly. See the EXAMPLE section for more; check the DIAGNOSTICS and FREQUENTLY ASKED QUESTIONS sections if you have trouble.

OpenType Features

OpenType fonts support optional features that change their appearance. Use the -f option to turn on selected features. For example, "-fsmcp" replaces lower-case letters with the corresponding small capitals, in fonts that support this.

You’ll generally provide at least the "-fkern" and "-fliga" options, which activate pair kerns and f-ligatures. Other interesting features include "-fcpsp", for capital spacing; "-fdlig", for optional ligatures; "-flnum", "-fonum", "-fpnum", and "-ftnum", to control digit glyphs; "-fsmcp", for small capitals; "-fswsh", for swash variants; and "-fcswh", for contextual swash. See the FEATURE DIRECTORY section below for more. The otfinfo(1) program will report which features a font supports; run "otfinfo -f fontfile.otf".

Feature options can also apply a feature to a subset of characters in the font. For example, "--lf smcp" only replaces letters with small capitals, whereas "-fsmcp" might additionally replace digits and punctuation marks with small-capital versions.

Automatic Mode

Automatic mode, triggered by the -a/--automatic option, installs font metrics and encoding files where TeX can find them, and additionally installs a Type 1 font and mapping for dvips(1) . This requires a TeX installation that follows the TeX Directory Structure standard (http://www.tug.org/tds/), such as most Unix TeX installations.

Here’s how to set up your account to use automatic mode smoothly. (These instructions were designed for web2c-based TeX installations.)

1.
Create a $HOME/texmf directory.
2.
Add a $HOME/texmf/dvips subdirectory to hold encodings and map files. Otftotfm will create and modify a file $HOME/texmf/dvips/lcdftools/lcdftools.map containing information about fonts it creates.
3.
Tell dvips(1) how to find the lcdftools.map file. The simplest way is to create a file $HOME/texmf/dvips/config.ps, containing the single line "p +lcdftools.map". You could also add this line to your ~/.dvipsrc or an existing config.ps, or create a script $HOME/texmf/dvips/updmap that does the right thing.

Now, you can run "otftotfm -a file.otf texname" and immediately refer to the font in TeX using the texname you supplied. Again, you will have to write ".fd" files and/or typescripts to make the font conveniently accessible from LaTeX or ConTeXt. See the DIAGNOSTICS section if you have problems with these instructions.

In automatic mode, otftotfm searches your $VARTEXMF or $TEXMF path for a writable directory, then installs files under that directory tree as follows:
File typeDirectoryFilename
TFMTEXMF/fonts/tfm/vendor/typeface/texname[--base].tfm
VFTEXMF/fonts/vf/vendor/typeface/texname.vf
PLTEXMF/fonts/pl/vendor/typeface/texname[--base].pl
VPLTEXMF/fonts/vpl/vendor/typeface/texname.vpl
encodingTEXMF/fonts/enc/dvips/vendor/a_signature.enc
or TEXMF/dvips/vendor/
PFB fontTEXMF/fonts/type1/vendor/typeface/PStexname.pfb
psfonts.mapTEXMF/fonts/map/dvips/vendor/vendor.map
or TEXMF/dvips/vendor/

"TEXMF" stands for the writable $TEXMF directory. Texname is the font name supplied as otftotfm’s second argument, and PStexname is the PostScript name of the input font. The vendor and typeface strings are required by TDS; they default to "lcdftools" and the font’s family name, respectively, but see the --vendor and --typeface options. Signature is an opaque 6-character encoding signature.

You can override these directories with environment variables and options as follows. Options take precedence over environment variables.
File typeEnvironment variableOption
TFMTFMDESTDIR--tfm-directory
VFVFDESTDIR--vf-directory
PLPLDESTDIR--pl-directory
VPLVPLDESTDIR--vpl-directory
encodingENCODINGDESTDIR--encoding-directory
PFB fontT1DESTDIR--type1-directory
psfonts.map---map-file

Otftotfm will update the TEXMF/ls-R file when installing files under TEXMF. After changing a psfonts.map file, it also checks for an executable file called TEXMF/dvips/updmap; if found, this file is executed from the TEXMF/dvips directory.

Example

This section uses MinionPro to show one way to install OpenType fonts for LaTeX. We begin with six fonts: "MinionPro-Regular.otf", "MinionPro-It.otf", "MinionPro-Semibold.otf", "MinionPro-SemiboldIt.otf", "MinionPro-Bold.otf", and "MinionPro-BoldIt.otf".

Our first task is to decide how to encode the fonts. The "encoding scheme" is used by TeX to decide how to typeset accents and symbols like "$". The "LY1" encoding scheme is a good choice for many OpenType fonts; it corresponds to the "texnansx.enc" encoding file, so we will supply otftotfm with the "-e texnansx" option.

Next, we decide on a naming scheme for the font metric files. Let’s use the OpenType font names as a base. (There’s generally no need to follow the six-character "Karl Berry" naming scheme.) Just in case we come back later and add a different encoding scheme, we’ll prepend "LY1--" to each name.

We’re now ready to run otftotfm for the first set of fonts. Note the "-fkern -fliga" options, which access pair kerns and the default "f" ligatures.


    otftotfm -a -e texnansx MinionPro-Regular.otf \
            -fkern -fliga LY1--MinionPro-Regular
    otftotfm -a -e texnansx MinionPro-It.otf \
            -fkern -fliga LY1--MinionPro-It
    otftotfm -a -e texnansx MinionPro-Semibold.otf \
            -fkern -fliga LY1--MinionPro-Semibold
    otftotfm -a -e texnansx MinionPro-SemiboldIt.otf \
            -fkern -fliga LY1--MinionPro-SemiboldIt
    otftotfm -a -e texnansx MinionPro-Bold.otf \
            -fkern -fliga LY1--MinionPro-Bold
    otftotfm -a -e texnansx MinionPro-BoldIt.otf \
            -fkern -fliga LY1--MinionPro-BoldIt

The small-caps fonts are generated with an additional "-fsmcp" option. We append "--fsmcp" to the font metric names as well, differentiating them from the regular fonts. Although MinionPro’s italic fonts support small-caps, the LaTeX font selection scheme can’t access them easily, so we’ve left them off.


    otftotfm -a -e texnansx MinionPro-Regular.otf \
            -fkern -fliga -fsmcp LY1--MinionPro-Regular--fsmcp
    otftotfm -a -e texnansx MinionPro-Semibold.otf \
            -fkern -fliga -fsmcp LY1--MinionPro-Semibold--fsmcp
    otftotfm -a -e texnansx MinionPro-Bold.otf \
            -fkern -fliga -fsmcp LY1--MinionPro-Bold--fsmcp

To get old-style numerals, just add the "-fonum" option to each invocation -- and, to reduce confusion, append "--fonum" to the font metric names.

At this point, all our font metric files are installed, and it’s finally time to create the ".fd" file. (The ".fd" format is documented in The LaTeX Companion.) Let’s call the LaTeX font family "MinionPro". Then the ".fd" file is "LY1MinionPro.fd", and it contains:


    \DeclareFontFamily{LY1}{MinionPro}{}
    \DeclareFontShape{LY1}{MinionPro}{m}{n}%
            { <-> LY1--MinionPro-Regular }{}
    \DeclareFontShape{LY1}{MinionPro}{m}{it}{ <-> LY1--MinionPro-It }{}
    \DeclareFontShape{LY1}{MinionPro}{m}{sc}%
            { <-> LY1--MinionPro-Regular--fsmcp }{}
    \DeclareFontShape{LY1}{MinionPro}{sb}{n}%
            { <-> LY1--MinionPro-Semibold }{}
    \DeclareFontShape{LY1}{MinionPro}{sb}{it}%
            { <-> LY1--MinionPro-SemiboldIt }{}
    \DeclareFontShape{LY1}{MinionPro}{sb}{sc}%
            { <-> LY1--MinionPro-Semibold--fsmcp }{}
    \DeclareFontShape{LY1}{MinionPro}{b}{n}{ <-> LY1--MinionPro-Bold }{}
    \DeclareFontShape{LY1}{MinionPro}{b}{it}%
            { <-> LY1--MinionPro-BoldIt }{}
    \DeclareFontShape{LY1}{MinionPro}{b}{sc}%
            { <-> LY1--MinionPro-Bold--fsmcp }{}
    \DeclareFontShape{LY1}{MinionPro}{bx}{n}%
            { <-> ssub * MinionPro/b/n }{}
    \DeclareFontShape{LY1}{MinionPro}{bx}{it}%
            { <-> ssub * MinionPro/b/it }{}
    \DeclareFontShape{LY1}{MinionPro}{bx}{sc}%
            { <-> ssub * MinionPro/b/sc }{}

We’re now ready to use MinionPro in LaTeX, with two lines like this in the document preamble:


    \usepackage[LY1]{fontenc}
    \renewcommand{\rmdefault}{MinionPro}
    \renewcommand{\bfdefault}{b}

Of course, we’re free at any time to add more MinionPro variants with otftotfm; they’ll become accessible to LaTeX as soon as we edit the "MinionPro.fd" file.

Options

With long options, you need type only as many characters as will make the option unique.

Font Feature and Transformation Options

-s script[.lang], --script=script[.lang]
Apply features suitable to the script system script and language system lang. Scripts and language systems are two-to-four-letter names assigned by Microsoft and Adobe. Examples include "latn" (Latin script), "grek" (Greek script), and "yi.YIC" (Yi script with classic characters). If lang is not specified, otftotfm will use the default language system for that script. You can give this option multiple times. Run "otfinfo -s font" to see the list of scripts and languages a font supports. Defaults to "latn".

-f feature, --feature=feature
Activate the feature named feature. Features are four-letter names assigned by Microsoft and Adobe; they are meant to correspond to font behaviors, such as kerning or small-capitals. Examples include "liga" (default ligatures), "dlig" (discretionary ligatures), "kern" (kerning), and "c2sc" (replacing capitals with small capitals). Give this option multiple times to apply multiple features. Run "otfinfo -f [--script option] font" to see the list of features a font supports for a specified script. Defaults to any features required by the selected scripts.

--lf feature, --letter-feature=feature
Activate the feature named feature, but only for letters. For instance, the "-f smcp" option will apply the small-caps feature to all characters in the encoding; this may result in changes to punctuation and numbers as well as letters. The "--lf smcp" option will apply the small-caps feature only to letters, meaning characters with the "Letter" Unicode property.

-E amt, --extend=amt
Widen, or extend, the font by a factor of amt. Like afm2tfm(1) ’s -e option.

-S amt, --slant=amt
Oblique, or slant, the font by amt. Like afm2tfm(1) ’s -s option.

-L amt, --letterspacing=amt
Letterspace each character by amt units, where 1000 units equals one em. The width of each character increases by amt, with half the space distributed to each sidebearing. Boundary-character kerns are added to maintain alignment at the ends of lines.

-k N, --min-kern=N
Only output kerning pairs whose absolute value is N or larger. Smaller minimum kerns make kerning more precise and the output TFM file bigger. The default minimum kern is 2.0.

--design-size=size
Set the output font’s design size to size, a value in TeX points. This value is mostly just documentation, since LaTeX essentially ignores fonts’ design sizes, but plain TeX may occasionally use the design size to decide how large a font should be. (Loading a font in TeX "at" a particular size effectively ignores the design size; loading a font plain or "scaled" by a given factor uses the design size.) The default is taken from the input font’s optical size feature, or 10pt if it has no such feature.

Encoding Options

-e encoding, --encoding=encoding
Selects the dvips(1) encoding used as a starting point. Otftotfm will search for encoding[.enc] the same way that dvips would, so you may not need to give a full pathname. See ENCODINGS, below, for more information on how otftotfm uses encodings. Say -e - to start with the font’s default encoding.

--literal-encoding=encoding
Selects the dvips(1) encoding used for the font. No glyph substitutions will be permitted, so the output encoding will equal the input encoding (and otftotfm will not generate an output encoding).

--ligkern=command
Executes the specified LIGKERN command in addition to any in the encoding. See ENCODINGS, below, for more information on LIGKERN syntax. For example, "--ligkern ’T {L} h’" suppresses any T_h ligature in the font. You can supply multiple --ligkern options.

--unicoding=command
Executes the specified UNICODING command in addition to any in the encoding. See ENCODINGS, below, for more information on UNICODINGs. For example, "--unicoding ’pi1 =: uni03D6’" tells otftotfm to encode "/pi1" as U+03D6 GREEK PI SYMBOL. You can supply multiple --unicoding options.

--no-encoding-commands
Ignore any LIGKERN and/or UNICODING commands in the encoding file.

--default-ligkern
Use otftotfm’s default LIGKERN commands, ignoring any from the encoding file. See ENCODINGS, below.

--coding-scheme=scheme
Sets the font’s TFM coding scheme to scheme, which must be a string less than 40 characters long containing no parentheses. The default is the encoding’s PostScript name. Most tools ignore the coding scheme, so you probably don’t need to worry about this command unless you are using fontinst.

--boundary-char=char
Sets the font’s boundary character to char, which should either be a single non-digit character, or a number between -1 and 255. The default is taken from the encoding.

--altselector-char=char
Sets the font’s alternate-selector character to char, which should either be a single non-digit character, or a number between -1 and 255. Use an alternate selector if you want to choose between different versions of a character from within a TeX file. For instance, say that your font provides three versions of "A". If you want to access them all, pick a character to be your alternate selector -- say "*". Then give otftotfm the --altselector-char=’*’ option. In TeX, "A" will produce the normal version, "A*" will produce the first alternate, and "A**" will produce the second alternate. Furthermore, "s*t" will activate any discretionary "s_t" ligature in the font. The default alternate-selector character is taken from the encoding.

The --altselector-char mechanism uses the features specified by --altselector-feature options. You don’t need to turn on those features if you use --altselector.

See Sivan Toledo’s article, cited in the See Also section, for more information.

--altselector-feature=feature
Activates the feature named feature for the --altselector-char mechanism. Give this option multiple times to activate multiple features. This option activates features only for use with --altselector-char; use the --feature option to activate features globally. Defaults to the salt and dlig features.

--include-alternates=pattern
Only include alternate characters whose names match pattern, which uses the glob matching rules common from filename matches (where "*" matches any number of characters, "?" matches any single character, and "[...]" matches any character in a set).

OpenType fonts can have many alternates per character, most of which aren’t interesting. For example, the character "a" in WarnockPro-Regular has five alternates, "ordfeminine", "Asmall", "asuperior", "a.end", and "orn.013". The --altselector-char option lets you cycle through these alternates, but it’s better to leave out the ones you don’t want, to avoid overfull encodings. Thus, if you were only interested in ".end" variants, you might run otftotfm with an --include-alternates=’*.end’ option.

--exclude-alternates=pattern
Do not include alternate characters whose names match pattern, which uses the glob matching rules common from filename matches.

You can give any number of --include- and --exclude-alternates options. Otftotfm will use an alternate if it matches at least one of the include patterns, and none of the exclude patterns. The patterns are applied to any feature introducing alternate characters, including "aalt" and "salt".

Automatic Mode Options

-a, --automatic
Select automatic mode.

-v vendor, --vendor=vendor
Set the font vendor name, which is used to locate files within the TDS. Defaults to "lcdftools".

In automatic mode, TeX and friends will generally find required font files independently of the vendor you select. However, you will need to explicitly tell dvips(1) to include vendor.map as a psfonts.map file, using a configuration line such as "p +vendor.map".

--typeface=typeface
Set the font typeface name, which is used to locate files within the TDS. Defaults to the current font’s family name with unsuiable characters removed.

--no-type1
Do not use cfftot1(1) to create Type 1 fonts corresponding to the OpenType input fonts.

--no-dotlessj
Do not use t1dotlessj(1) to create a special dotless-j font when the input font doesn’t have dotless-j.

Output Options

-n texname, --name=texname
Set the TeX name of the output font, which is used in the dvips(1) psfonts.map line and, in automatic mode, to generate the output filename. The default is derived from the OpenType font’s name and the features you selected.

-p, --pl
Output human-readable PL and VPL metrics, not binary TFM and VF metrics. Note: Otftotfm’s PL and VPL output files are legal, but the fontinst program may not accept them (it has a picky parser). Make sure to supply a --coding-scheme; if that doesn’t help, run the TFM output through tftopl(1) .

--no-virtual
Do not generate virtual fonts (VFs and VPLs). Otftotfm will warn if the selected font features cannot be implemented without virtual fonts.

--no-encoding
Do not generate an encoding file.

--no-map
Do not generate a psfonts.map line for the font.

File Location Options

--tfm-directory=dir
The directory used for output TFM font metrics. Defaults to the TFMDESTDIR environment variable. If that’s not set, it defaults to "." in manual mode, or a TDS directory in automatic mode (see above).

--pl-directory=dir
--vf-directory=dir
--vpl-directory=dir
--encoding-directory=dir
--type1-directory=dir
These options act like --tfm-directory for other file types. The default environment variables are described above. All default to ".".

--map-file=filename
Set file in which otftotfm will write a psfonts.map line for the font. The default is the standard output in manual mode, and "TEXMF/fonts/map/dvips/vendor/vendor.map" (or "TEXMF/dvips/vendor/vendor.map" on older installations) in automatic mode.

Miscellaneous Options

--glyphlist=file
Use file as the Adobe glyph list, which helps translate glyph names to Unicode code points. See ENCODINGS, below, for more information.

-V, --verbose
Write progress messages to standard error.

--no-create
Do not create or modify any files. Instead, write messages about the program’s hypothetical progress to standard error.

-q, --quiet
Do not generate any error messages.

--kpathsea-debug=flags
Sets path searching debugging flags. See the Kpathsea manual for details.

-h, --help
Print usage information and exit.

--version
Print the version number and some short non-warranty information and exit.

Encodings

Otftotfm interprets encoding files as Unicode. For example, if an input encoding has "/dotlessi" at position 10, then otftotfm detects that the user wants to encode Unicode character U+0131 LATIN SMALL LETTER DOTLESS I at position 10. The output encoding will use whatever glyph the font suggests for that Unicode character, given the collection of features you chose.

You can control this process with "UNICODING" comments in the input encoding file. UNICODING comments have the following format:

    % UNICODING glyph =: choice1 [choice2 ...] ;
Glyph and the choices are PostScript glyph names. This comment tells otftotfm that the glyph named glyph translates into the first Unicode value in the choice list that has a character in the font. For example,
    % UNICODING pi1 =: uni03D6 ;
tells otftotfm that the character "/pi1" encodes as U+03D6 GREEK PI SYMBOL, and
    % UNICODING Delta =: uni0394 uni2206 ;
tells it that U+0394 GREEK CAPITAL LETTER DELTA should be preferred to U+2206 INCREMENT as an encoding for "/Delta". You can also supply regular glyph names:
    % UNICODING Delta =: Deltagreek Delta ;
Otftotfm uses Adobe’s glyphlist.txt file to translate glyph names to Unicode; see http://partners.adobe.com/asn/developer/type/unicodegn.html.

You can map a glyph to nothing to remove that glyph from the input encoding. This is useful to remove optional characters; for instance:

    % UNICODING ff =: ; fi =: ; fl =: ; ffi =: ; ffl =: ;
The f-ligatures will be added back to the encoding, preferably at their original locations, if some font feature requires them.

Map a glyph to ’emptyslot’ if you don’t want otftotfm to use the slot for a ligature character. For example, given this UNICODING,

   % UNICODING ff =: ff emptyslot ;
otftotfm will leave the ’ff’ encoding slot unused if the font has no ’ff’ glyph. (Note that most OpenType fonts provide a visible representation for unused encoding slots, namely a box with an X inside.)

Each UNICODING line can contain multiple commands, separated by spaced semicolons.

LIGKERN comments in the encoding can add ligatures and inhibit kerns, as in afm2tfm(1) . To add a ligature, say:

    % LIGKERN glyph1 glyph2 =: result ;
The "=:" operator indicates a normal ligature, where both the input glyphs are removed and replaced by result. To preserve the left-hand glyph, for an effect like "glyph1 glyph2 =: glyph1 result", use "|=:" instead; to preserve the right-hand glyph, use "=:|". The other five ligature operators are not yet supported. To remove all kerns between two characters, say:
    % LIGKERN glyph1 {} glyph2 ;
A "*" matches any character, so
    % LIGKERN a {} * ;
removes all kerns with "a" as the left-hand character, and
    % LIGKERN * {} * ;
removes all kerns.

Otftotfm can also inhibit ligatures via LIGKERNX commands. This:

    % LIGKERNX glyph1 {L} glyph2 ;
inhibits any ligature between glyph1 and glyph2. "{K}", like "{}", inhibits kerns only, and "{LK}" and "{KL}" inhibit both ligatures and kerns.

You can set the --boundary-char and --altselector-char from an encoding file with commands like this:

    % LIGKERN || = boundarychar ;
    % LIGKERNX ^^ = altselectorchar ;
As with UNICODING, each LIGKERN or LIGKERNX line can contain multiple commands, separated by spaced semicolons.

Finally, the CODINGSCHEME command specifies a default --coding-scheme for the encoding; for example:

    % CODINGSCHEME EXTENDED TEX FONT ENCODING

The --unicoding and --ligkern options let you add virtual UNICODING and LIGKERN comments to an encoding.

Otftotfm has a default set of eight ligatures, namely:

    space l =: lslash ; space L =: Lslash ;
    question quoteleft =: questiondown ; exclam quoteleft =: exclamdown
;
    hyphen hyphen =: endash ; endash hyphen =: emdash ;
    quoteleft quoteleft =: quotedblleft ; 
    quoteright quoteright =: quotedblright
LIGKERN commands in the encoding file and/or --ligkern options normally inhibit the defaults.

Some common encoding files have commands that are inappropriate for OpenType fonts. For example, "t1.enc" hard-codes f-ligatures, which can cause problems with small-cap fonts. Supply the --no-encoding-commands option to ignore all commands from the encoding file, or the --default-ligkern option to ignore LIGKERN commands (but apply the default ligatures). Explicit --ligkern and --unicoding options are processed in any case.

New Glyphs

New glyphs, such as ligatures and contextual substitutions, are added to the encoding in any empty spaces, using their original locations when possible. If the encoding doesn’t have enough space for all new glyphs, shorter ligatures composed of unaccented letters get precedence.

Synthetic Glyphs

Otftotfm can synthesize some glyphs using virtual font manipulations, if a required glyph is not available in the input font. Specifically, it will synthesize "IJ", "ij", "Germandbls" (a capital "sharp-s", namely "SS"), "SSsmall" (similarly, a small-capital "sharp-s"), "cwm" (the TeX T1 encoding’s compound word mark), and "visualspace" (the TeX T1 encoding’s visible space).

Feature Directory

This section lists features common to Western OpenType fonts and describes how otftotfm handles them for common fonts. Please send the author mail if otftotfm does not handle a feature you need, or you believe it handles some feature incorrectly.

aalt, Access All Alternates
Lets the user choose between all available alternate forms for a character. This includes things like superscript and subscript variants, different styles (swash, for example), and even ornaments. The --altselector-feature=aalt option can help an --altselector-char provide useful access to alternates, but the aalt feature isn’t usually useful on its own. Try the salt and calt features instead.
c2sc, Small Capitals From Capitals
Replaces capital letters with small capitals: a sort of converse of the more conventional smcp feature, which replaces lower-case letters with small capitals. Supported.
calt, Contextual Alternates
Lets the user choose between context-appropriate swash forms for each character. For example, given the word "DREW" in a cursive typeface, the "R E W" might be translated to calmer forms than the initial "D". There may be more than one choice for a given letter, in which case the user should be able to select among them. TeX can’t support complex contextual alternates, or alternate selection, but otftotfm supports some fonts quite well. The input encoding should have lots of empty space for variants, and it should specify a boundary character. See also cswh.
case, Case-Sensitive Forms
Shifts punctuation marks up to a position that works well with all-capital-letter sequences. For example, the hyphen character, which generally centers vertically on the x-height, is raised up to center vertically on a capital letter. Also replaces text figures with lining figures, and accent marks with forms more appropriate for capitals. Supported.
cpsp, Capital Spacing
Adds a bit of space on either side of each capital letter. Supported. (However, the OpenType tag registry suggests that cpsp be on by default, but applying to all-caps text only; TeX cannot easily implement that contextual intelligence.)
cswh, Contextual Swash
Lets the user choose between context-appropriate swash forms for each character. For example, in the words "Ab AC", the first "A" might be translated to a swash form, while the second might not. There may be more than one choice for a given letter, in which case the user should be able to select among them. TeX can’t support complex contextual swashes, or alternate selection, but otftotfm supports some fonts quite well. The input encoding should have lots of empty space for swash variants, and it should specify a boundary character. See also calt.
dlig, Discretionary Ligatures
Activates uncommon ligatures, such as "c_t", "s_p", and "s_t". Supported.
dnom, Denominators
Replaces digits and some punctuation marks with smaller forms sitting on the baseline, intended for fraction denominators. Supported.
fina, Terminal Forms
Substitutes appropriate forms for letters occurring at the ends of words. This feature doesn’t select swash variants; it’s intended for normal use, and the specification recommends that it be on by default. Partially supported: TeX will only treat spaces as the ends of words, where a correct implementation would probably include punctuation too. See cswh for selecting swash variants active at the ends of words.
frac, Fractions
Replaces simple sequences like "1/2" with nice-looking fractions. Supported, but beware: many fonts will translate "11/32" into "1" + "1/3" + "2".
hist, Historical Forms
Replaces characters with historical variants. Usually, this means at least translating regular "s" to long "s". Supported.
kern, Kerning
Adjusts the space between characters (pair kerning). Generally supported, and you should probably turn it on.
liga, Standard Ligatures
Activates common ligatures, such as "f_f", "f_i", "f_f_j", and (in some Adobe fonts) "T_h". Generally supported, and you should probably turn it on.
lnum, Lining Figures
Uses lining figures, the set of digits that are all about as high as capital letters. Supported. Compare onum; see also pnum and tnum.
numr, Numerators
Replaces digits and some punctuation marks with smaller, raised forms intended for fraction numerators. Supported, but not usually useful.
onum, Oldstyle Figures
Uses old-style figures, also known as text figures. This is the set of digits that have ascenders and descenders like lower-case letters. Supported. Compare lnum; see also pnum and tnum.
ordn, Ordinals
Designed for Spanish and French. Replaces ordinal numbers, such as "2.o", with forms where the "o" is raised, and replaces the sequence "No" with an integrated glyph. Supported.
ornm, Ornaments
Replaces some alphabetic characters in the font with ornaments, and links the bullet character to a set of all bullet-like ornaments, from which the user can choose. Partially supported: TeX can handle alphabetic substitutions, but not bullet choice.
pnum, Proportional Figures
Digits will have different widths. Supported. Compare tnum; see also lnum and onum.
salt, Stylistic Alternates
Lets the user choose between stylistic alternate forms for a character. The --altselector-char mechanism provides useful access to this feature. If you turn on salt globally, otftotfm takes the first alternate form whenever there’s more than one choice. See also aalt and ss01; salt is generally more useful than aalt for TeX, since it refers exclusively to stylistic alternates.
sinf, Scientific Inferiors
Replaces digits and some punctuation marks with smaller, lowered forms intended for subscripts. Supported.
size, Optical Size
This feature stores information about the range of optical sizes for which the font was intended. There is no point in selecting it with otftotfm, since it should not change the font’s appearance in any way.
smcp, Small Capitals
Replaces lower-case letters with small capitals. Supported. Compare c2sc.
ss01-ss20, Stylistic Sets 1-20
Replaces characters with a uniform set of stylistic alternates. Differs from features like salt in that a Stylistic Set is uniform: an ssXX feature should never involve selection from a set of possible alternate characters. Supported.
sups, Superscript
Replaces digits, some punctuation marks, and some lower-case letters with smaller, raised forms intended for superscripts. Supported.
swsh, Swash
Activates all swash forms for each character. There may be more than one swash form, in which case otftotfm will pick the first one listed. Supported, except that swash variants other than the first are inaccessible.
tnum, Tabular Figures
All digits will have the same width, so that tables and the like will align visually. Supported. Compare pnum; see also lnum and onum.
zero, Slashed Zero
Replaces the zero character with a slashed zero. Supported.

Diagnostics and Troubleshooting

no writable directory found in $TEXMF
Otftotfm could not find a writable directory in your $VARTEXMF or $TEXMF path. Did you create a $HOME/texmf directory? If so, run the command "kpsewhich --expand-path=’$TEXMF’" to verify that directory is not being found. You may need to set your TEXMF environment variable, to ’{!!’"$HOME"’/texmf,!!$TEXMFMAIN}’, for instance (note the different kinds of quotes; on my machine, this expands to ’{!!/home/kohler/texmf,!!$TEXMFMAIN}’).
char’ has no encoding, ignoring kern removal
(or ligature removal, lig/kern removal, or ligature)
These messages indicate a slight problem with your encoding file: one of the LIGKERN commands referred to a character not present in the encoding. This might be due to a misspelling in the LIGKERN command or the encoding file, or it might be an oversight. Either fix the encoding file or ignore the warning.
can’t map ’char’ to Unicode
Another encoding file problem: One of the glyph names in an UNICODING block could not be converted to Unicode. This is problematic since UNICODING exists wholly to translate glyph names into Unicode. Fix the encoding file or ignore the warning.
not enough room in encoding, ignoring N glyph(s) ...
There wasn’t space in the encoding for all the glyphs referred to by the features you selected. For example, maybe the font had more ligatures than there were empty slots in the encoding. Fix this warning by selecting fewer features, or by using an encoding with more empty slots, such as the 7t.enc encoding distributed with otftotfm.

Frequently Asked Questions

How can I get a small-caps "SS" in place of the German sharp-S?
Supply the option "--unicoding ’germandbls =: SSsmall’".
How can I prevent f-ligatures from forming in a small-caps font?
This should happen automatically, but some overzealous encoding files add f-ligatures even when the font doesn’t request them. Try the "--default-ligkern" option if this is a problem for you.

Bugs

Presumably some context-sensitive positionings and ligatures could be implemented with TeX’s boundary character, but otftotfm doesn’t do that yet.

See the documentation for --pl above if you have problems running otftotfm’s output through fontinst.

See Also

pltotf(1) , tftopl(1) , vptovf(1) , afm2tfm(1) , dvips(1) , cfftot1(1) , otfinfo(1) , t1dotlessj(1) , kpsewhich(1)

Adobe Type 1 Font Format

Adobe Technical Notes #5176, The Compact Font Format Specification, and #5177, The Type 2 Charstring Format

OpenType Specification, Version 1.4

A Directory Structure for TeX Files, http://www.tug.org/tds/

Kpathsea: A library for path searching, http://www.tug.org/kpathsea/

Sivan Toledo, Exploiting Rich Fonts, TUGboat 21(2), 2000, http://www.tug.org/TUGboat/Articles/tb21-2/tb67tole.pdf

Michel Goossens, Frank Mittelbach, and Alexander Samarin, The LaTeX Companion (for information on the .fd file format).

Author

Eddie Kohler (kohler@icir.org)

Thanks to Karl Berry, Marco Kuhlmann, Adam Lindsay, Bruce D’Arcus, and Claire Connelly for suggestions, bug reports, and help.


Table of Contents