1OTFTOTFM(1) General Commands Manual OTFTOTFM(1)
2
3
4
6 otftotfm - create TeX font metrics from OpenType fonts
7
9 otftotfm [-a] [options] fontfile [texname]
10
12 Otftotfm creates the font metric and encoding files required to use an
13 OpenType font with TeX. You supply an OpenType ".otf" or ".ttf" font
14 file, a base ".enc" encoding, and a TeX name "texname" for the result‐
15 ing font, and say which OpenType features should be turned on. Then
16 otftotfm generates and installs the corresponding TeX-related metric
17 files (".tfm" TeX font metrics, ".vf" virtual fonts, and ".enc" encod‐
18 ing files). It works on both PostScript-flavored and TrueType-flavored
19 OpenType fonts, although TrueType-flavor support will only work easily
20 with pdftex.
21
22 The easiest way to use otftotfm is with the -a option; see Automatic
23 Mode below. Without -a, otftotfm writes all its output files to the
24 current directory.
25
26 After running "otftotfm fontfile texname" and installing the results
27 (manually or with -a), you can use the OpenType font in plain TeX with
28 a command like this:
29
30 \font\myfont=texname at 10pt
31 {\myfont This text uses the OpenType font.}
32
33 LaTeX users will generally make a ".fd" input file so that commands
34 like "\renewcommand{\rmdefault}{TeXName}" work correctly. See the
35 EXAMPLE section for more; check the DIAGNOSTICS and FREQUENTLY ASKED
36 QUESTIONS sections if you have trouble.
37
38 OpenType Features
39 OpenType fonts support optional features that change their appearance.
40 Use the -f option to turn on selected features. For example, "-fsmcp"
41 replaces lower-case letters with the corresponding small capitals, in
42 fonts that support this.
43
44 You'll generally provide at least the "-fkern" and "-fliga" options,
45 which activate pair kerns and f-ligatures. Other interesting features
46 include "-fcpsp", for capital spacing; "-fdlig", for optional liga‐
47 tures; "-flnum", "-fonum", "-fpnum", and "-ftnum", to control digit
48 glyphs; "-fsmcp", for small capitals; "-fswsh", for swash variants; and
49 "-fcswh", for contextual swash. See the FEATURE DIRECTORY section
50 below for more. The otfinfo(1) program will report which features a
51 font supports; run "otfinfo -f fontfile".
52
53 Feature options can also apply a feature to a subset of characters in
54 the font. For example, "--lf smcp" only replaces letters with small
55 capitals, whereas "-fsmcp" might additionally replace digits and punc‐
56 tuation marks with small-capital versions.
57
58 Automatic Mode
59 Automatic mode, triggered by the -a/--automatic option, installs font
60 metrics and encoding files where TeX can find them, and additionally
61 installs a Type 1 font and mapping for dvips(1). This requires a TeX
62 installation that follows the TeX Directory Structure standard
63 (http://www.tug.org/tds/), such as most Unix TeX installations.
64
65 Automatic mode should run seamlessly out of the box. Otftotfm will
66 install metrics files, encodings, map files, and Type 1 fonts into
67 $HOME/.texmf-var or any other writable TEXMF directory, and run
68 updmap(1) to update the global lists of installed fonts. (On older
69 teTeX installations, you may first need to copy the system's updmap.cfg
70 file to $HOME/texmf/web2c and run mktexlsr(1). On newer TeXLive
71 installations, you may need to set the TEXMFVAR environment variable.)
72 You can then run "otftotfm -a fontfile texname" and immediately refer
73 to the font in TeX using the texname you supplied. Again, you will
74 have to write ".fd" files and/or typescripts to make the font conve‐
75 niently accessible from LaTeX or ConTeXt. See the DIAGNOSTICS section
76 if you have problems with these instructions.
77
78 In automatic mode, otftotfm searches your $TEXMFVAR or $TEXMF path for
79 a writable directory, then installs files under that directory tree as
80 follows:
81
82 File type Directory Filename
83 TFM TEXMF/fonts/tfm/vendor/typeface/ texname[--base].tfm
84 VF TEXMF/fonts/vf/vendor/typeface/ texname.vf
85 PL TEXMF/fonts/pl/vendor/typeface/ texname[--base].pl
86 VPL TEXMF/fonts/vpl/vendor/typeface/ texname.vpl
87 encoding TEXMF/fonts/enc/dvips/vendor/ a_signature.enc
88 or TEXMF/dvips/vendor/
89 font map TEXMF/fonts/map/dvips/vendor/ vendor.map
90 or TEXMF/dvips/vendor/
91
92 "TEXMF" stands for the writable TEXMF directory. Texname is the font
93 name supplied as otftotfm's second argument. The vendor and typeface
94 strings are required by TDS; they default to "lcdftools" and the font's
95 family name, respectively, but see the --vendor and --typeface options.
96 Signature is an opaque 6-character encoding signature.
97
98 Otftotfm also installs a font file suitable for printing. PostScript-
99 flavored OpenType fonts are translated to Type 1 format and installed
100 as PFB fonts; TrueType-flavored fonts are installed as is (pdftex and
101 pdflatex can read TrueType directly). However, otftotfm will not
102 install a font file if one already exists. The installation paths are
103 as follows, where PSname is the font's PostScript name.
104
105 PFB TEXMF/fonts/type1/vendor/typeface/ PSname.pfb
106 TrueType TEXMF/fonts/truetype/vendor/typeface/ fontfile
107
108 You can override these directories with environment variables and
109 options as follows. Options take precedence over environment vari‐
110 ables.
111
112 File type Environment variable Option
113 TFM TFMDESTDIR --tfm-directory
114 VF VFDESTDIR --vf-directory
115 PL PLDESTDIR --pl-directory
116 VPL VPLDESTDIR --vpl-directory
117 encoding ENCODINGDESTDIR --encoding-directory
118 PFB T1DESTDIR --type1-directory
119 TrueType TRUETYPEDESTDIR --truetype-directory
120 font map - --map-file
121
122 Otftotfm will update the TEXMF/ls-R file when installing files under
123 TEXMF. It will also run the updmap(1) program after changing a map
124 file, unless the --no-updmap option was supplied. However, if an exe‐
125 cutable file called TEXMF/dvips/updmap exists, this file is executed
126 (from the TEXMF/dvips directory) rather than the global updmap. This
127 is so you can write a fast, customized version of updmap if desired.
128
130 This section uses MinionPro to show one way to install OpenType fonts
131 for LaTeX. We begin with six fonts: "MinionPro-Regular.otf", "Minion‐
132 Pro-It.otf", "MinionPro-Semibold.otf", "MinionPro-SemiboldIt.otf",
133 "MinionPro-Bold.otf", and "MinionPro-BoldIt.otf".
134
135 Our first task is to decide how to encode the fonts. The "encoding
136 scheme" is used by TeX to decide how to typeset accents and symbols
137 like "$". The "LY1" encoding scheme has reasonable accent support and
138 is a good choice for many OpenType fonts. LY1 corresponds to the "tex‐
139 nansx.enc" encoding file, so we will supply otftotfm with the "-e tex‐
140 nansx" option.
141
142 Expert note: Strictly speaking, LY1 corresponds to the "tex‐
143 nansi.enc" encoding file. Since the "texnansx.enc" version
144 omits duplicate characters, it has more room for font-specific
145 glyphs and is generally a better choice; but if you plan to type
146 characters like "ae" directly into your editor, rather than
147 using TeX commands like \ae, you should use "texnansi.enc".
148
149 Next, we decide on a naming scheme for the font metric files. Let's
150 use the OpenType font names as a base. (There's generally no need to
151 follow the six-character "Karl Berry" naming scheme.) Just in case we
152 come back later and add a different encoding scheme, we'll prepend
153 "LY1--" to each name.
154
155 We're now ready to run otftotfm for the first set of fonts. Note the
156 "-fkern -fliga" options, which access pair kerns and the default "f"
157 ligatures.
158
159 otftotfm -a -e texnansx MinionPro-Regular.otf \
160 -fkern -fliga LY1--MinionPro-Regular
161 otftotfm -a -e texnansx MinionPro-It.otf \
162 -fkern -fliga LY1--MinionPro-It
163 otftotfm -a -e texnansx MinionPro-Semibold.otf \
164 -fkern -fliga LY1--MinionPro-Semibold
165 otftotfm -a -e texnansx MinionPro-SemiboldIt.otf \
166 -fkern -fliga LY1--MinionPro-SemiboldIt
167 otftotfm -a -e texnansx MinionPro-Bold.otf \
168 -fkern -fliga LY1--MinionPro-Bold
169 otftotfm -a -e texnansx MinionPro-BoldIt.otf \
170 -fkern -fliga LY1--MinionPro-BoldIt
171
172 The small-caps fonts are generated with an additional "-fsmcp" option.
173 We append "--fsmcp" to the font metric names as well, differentiating
174 them from the regular fonts. Although MinionPro's italic fonts support
175 small-caps, the LaTeX font selection scheme can't access them easily,
176 so we've left them off.
177
178 otftotfm -a -e texnansx MinionPro-Regular.otf \
179 -fkern -fliga -fsmcp LY1--MinionPro-Regular--fsmcp
180 otftotfm -a -e texnansx MinionPro-Semibold.otf \
181 -fkern -fliga -fsmcp LY1--MinionPro-Semibold--fsmcp
182 otftotfm -a -e texnansx MinionPro-Bold.otf \
183 -fkern -fliga -fsmcp LY1--MinionPro-Bold--fsmcp
184
185 To get old-style numerals, just add the "-fonum" option to each invoca‐
186 tion -- and, to reduce confusion, append "--fonum" to the font metric
187 names.
188
189 At this point, all our font metric files are installed, and it's
190 finally time to create the ".fd" file. (The ".fd" format is documented
191 in The LaTeX Companion.) Let's call the LaTeX font family "MinionPro".
192 Then the ".fd" file is "LY1MinionPro.fd", and it contains:
193
194 \DeclareFontFamily{LY1}{MinionPro}{}
195 \DeclareFontShape{LY1}{MinionPro}{m}{n}%
196 { <-> LY1--MinionPro-Regular }{}
197 \DeclareFontShape{LY1}{MinionPro}{m}{it}{ <-> LY1--MinionPro-It }{}
198 \DeclareFontShape{LY1}{MinionPro}{m}{sc}%
199 { <-> LY1--MinionPro-Regular--fsmcp }{}
200 \DeclareFontShape{LY1}{MinionPro}{sb}{n}%
201 { <-> LY1--MinionPro-Semibold }{}
202 \DeclareFontShape{LY1}{MinionPro}{sb}{it}%
203 { <-> LY1--MinionPro-SemiboldIt }{}
204 \DeclareFontShape{LY1}{MinionPro}{sb}{sc}%
205 { <-> LY1--MinionPro-Semibold--fsmcp }{}
206 \DeclareFontShape{LY1}{MinionPro}{b}{n}{ <-> LY1--MinionPro-Bold }{}
207 \DeclareFontShape{LY1}{MinionPro}{b}{it}%
208 { <-> LY1--MinionPro-BoldIt }{}
209 \DeclareFontShape{LY1}{MinionPro}{b}{sc}%
210 { <-> LY1--MinionPro-Bold--fsmcp }{}
211 \DeclareFontShape{LY1}{MinionPro}{bx}{n}%
212 { <-> ssub * MinionPro/b/n }{}
213 \DeclareFontShape{LY1}{MinionPro}{bx}{it}%
214 { <-> ssub * MinionPro/b/it }{}
215 \DeclareFontShape{LY1}{MinionPro}{bx}{sc}%
216 { <-> ssub * MinionPro/b/sc }{}
217
218 We're now ready to use MinionPro in LaTeX, with lines like this in the
219 document preamble:
220
221 \usepackage[LY1]{fontenc}
222 \renewcommand{\rmdefault}{MinionPro}
223 \renewcommand{\bfdefault}{b}
224
225 Of course, we're free at any time to add more MinionPro variants with
226 otftotfm; they'll become accessible to LaTeX as soon as we edit the
227 "MinionPro.fd" file.
228
230 With long options, you need type only as many characters as will make
231 the option unique.
232
233 Font Feature and Transformation Options
234 -s script[.lang], --script=script[.lang]
235 Apply features suitable to the script system script and language
236 system lang. Scripts and language systems are two-to-four-letter
237 names assigned by Microsoft and Adobe. Examples include "latn"
238 (Latin script), "grek" (Greek script), and "yi.YIC" (Yi script
239 with classic characters). If lang is not specified, otftotfm will
240 use the default language system for that script. You can give
241 this option multiple times. Run "otfinfo -s font" to see the list
242 of scripts and languages a font supports. Defaults to "latn".
243
244 -f feature, --feature=feature
245 Activate the feature named feature. Features are four-letter
246 names assigned by Microsoft and Adobe; they are meant to corre‐
247 spond to font behaviors, such as kerning or small-capitals. Exam‐
248 ples include "liga" (default ligatures), "dlig" (discretionary
249 ligatures), "kern" (kerning), and "c2sc" (replacing capitals with
250 small capitals). Give this option multiple times to apply multi‐
251 ple features. Run "otfinfo -f [--script option] font" to see the
252 list of features a font supports for a specified script. Defaults
253 to any features required by the selected scripts.
254
255 --lf feature, --letter-feature=feature
256 Activate the feature named feature, but only for letters. For
257 instance, the "-f smcp" option will apply the small-caps feature
258 to all characters in the encoding; this may result in changes to
259 punctuation and numbers as well as letters. The "--lf smcp"
260 option will apply the small-caps feature only to letters, meaning
261 characters with the "Letter" Unicode property.
262
263 --subs-filter pattern
264 --include-subs pattern
265 --exclude-subs pattern
266 --clear-subs
267 Limit the characters that otftotfm will substitute. Substitution
268 is allowed on an input character if it matches at least one of the
269 --include patterns, and none of the --exclude patterns. Each pat‐
270 tern applies to all following features, except that the --clear
271 option clears any accumulated patterns. The --subs-filter pattern
272 option acts like --clear-subs followed by --include-subs pattern.
273 For pattern syntax, see GLYPH PATTERNS, below.
274
275 In the command line below, the '<Number>' pattern will force the
276 "onum" feature to substitute only numbers (and not, for example,
277 punctuation). The "salt" feature can still substitute any charac‐
278 ter.
279 otftotfm -fsalt --include-subs="<Number>" -fonum ...
280
281 -E fac, --extend=fac
282 Widen, or extend, the font by a factor of fac. Like afm2tfm(1)'s
283 -e option.
284
285 -S amt, --slant=amt
286 Oblique, or slant, the font by amt. Like afm2tfm(1)'s -s option.
287
288 -L amt, --letterspacing=amt
289 Letterspace each character by amt units, where 1000 units equals
290 one em. The width of each character increases by amt, with half
291 the space distributed to each sidebearing. Boundary-character
292 kerns are added to maintain alignment at the ends of lines.
293
294 --math-spacing[=skewchar]
295 Ignore the font's claimed character widths, deriving horizontal
296 metrics from bounding boxes instead. This results in similar
297 spacing as the Computer Modern Math Italic font, with increased
298 sidebearings for letters like f and j.
299
300 If you provide skewchar, a number between 0 and 255 or a single
301 character, then otftotfm adds heuristically-derived kerns to the
302 font that may improve accent positions in math mode. To get the
303 benefits, you must tell TeX about the skewchar with a command like
304 "\skewchar\font=skewchar".
305
306 -k N, --min-kern=N
307 Only output kerning pairs whose absolute value is N or larger.
308 Larger minimum kerns make kerning less precise, but shrink the
309 output TFM file. The default minimum kern is 2.0, or 0.002 em.
310
311 --space-factor=fac
312 Scale the width of the inter-word space by a factor of fac.
313
314 --design-size=size
315 Set the output font's design size to size, a value in TeX points.
316 This value is mostly just documentation, since LaTeX essentially
317 ignores fonts' design sizes, but plain TeX may occasionally use
318 the design size to decide how large a font should be. (Loading a
319 font in TeX "at" a particular size effectively ignores the design
320 size; loading a font plain or "scaled" by a given factor uses the
321 design size.) The default is taken from the input font's optical
322 size feature, or 10pt if it has no such feature.
323
324 --fixed-width
325 Set the font to fixed-width (its space character will have no
326 stretch or shrink). Normally you won't need this option; the font
327 will tell otftotfm whether it is fixed width. The opposite of
328 --fixed-width is --proportional-width.
329
330 --italic-angle=angle
331 Set the output font's default italic angle to angle, a number of
332 degrees. This value is used by TeX to position accents. Normally
333 you won't need this option; the font will tell otftotfm its italic
334 angle.
335
336 Encoding Options
337 -e encoding, --encoding=encoding
338 Select the output metrics's base dvips(1) encoding. Otftotfm will
339 search for encoding[.enc] the same way that dvips would, so you
340 may not need to give a full pathname. Say -e - to start with the
341 font's default encoding. See ENCODINGS, below, for more informa‐
342 tion.
343
344 --boundary-char=char
345 Set the font's boundary character to char, which should either be
346 a single non-digit character, or a number between -1 and 255. The
347 default is taken from the encoding.
348
349 --altselector-char=char
350 Set the font's alternate selector character to char, which should
351 either be a single non-digit character, or a number between -1 and
352 255. Alternate selectors let TeX authors explicitly choose
353 between versions of a character. For instance, the '--altselec‐
354 tor-char="*"' option turns the "*" character into a special switch
355 that cycles between alternates. For instance, the TeX input "A"
356 would produce the normal version of the "A" Unicode character,
357 "A*" would produce the first alternate, "A**" would produce the
358 second alternate, and so forth. Furthermore, "s*t" will activate
359 any discretionary "s_t" ligature in the font.
360
361 The --altselector-char mechanism uses the features specified by
362 --altselector-feature options.
363
364 The alternate-selector character may also be specified in the
365 encoding; see ENCODINGS, below. See Sivan Toledo's article cited
366 in the SEE ALSO section for more information.
367
368 --altselector-feature=feature
369 Activate the feature named feature for the --altselector-char
370 mechanism. Give this option multiple times to activate multiple
371 features. This option activates features only for use with --alt‐
372 selector-char; use the --feature option to activate features glob‐
373 ally. Defaults to the salt and dlig features.
374
375 --alternates-filter=pattern
376 --include-alternates=pattern
377 --exclude-alternates=pattern
378 --clear-alternates
379 Limit the alternate characters that otftotfm will select. An
380 alternate is used if it matches at least one of the --include pat‐
381 terns, and none of the --exclude patterns. Each pattern applies
382 to all following features, except that the --clear option clears
383 any accumulated patterns. The --alternates-filter pattern option
384 acts like --clear-alternates followed by --include-alternates pat‐
385 tern. For pattern syntax, see GLYPH PATTERNS, below.
386
387 OpenType fonts can have many alternates per character, most of
388 which aren't interesting. For example, the character "a" in
389 WarnockPro-Regular has five alternates, "ordfeminine", "Asmall",
390 "asuperior", "a.end", and "orn.013". The --altselector-char
391 option lets you cycle through these alternates, but it's better to
392 leave out the ones you don't want, to avoid overfull encodings.
393 Thus, if you were only interested in ".end" variants, you might
394 supply an '--include-alternates="*.end"' option.
395
396 In the command line below, the '*.end' pattern will apply to
397 "aalt" alternates, but not to "salt" alternates.
398 otftotfm -fsalt --include-alternates="*.end" -faalt ...
399
400 --ligkern=command
401 Add a LIGKERN command to the encoding. For example, '--ligkern "T
402 {L} h"' suppresses any T_h ligature in the font. You can supply
403 multiple --ligkern options. See ENCODINGS, below.
404
405 --position=command
406 Add a POSITION command to the encoding. For example, '--position
407 "T 10 0 20"' adds ten units of space to either side of the "T"
408 character. You can supply multiple --position options. See
409 ENCODINGS, below.
410
411 --unicoding=command
412 Add a UNICODING command to the encoding. For example, '--unicod‐
413 ing "pi1 =: uni03D6"' tells otftotfm to encode "/pi1" as U+03D6
414 GREEK PI SYMBOL. You can supply multiple --unicoding options.
415 See ENCODINGS, below.
416
417 --no-encoding-commands
418 Ignore any LIGKERN and/or UNICODING commands in the encoding file.
419
420 --no-default-ligkern
421 Don't include otftotfm's default LIGKERN commands.
422
423 --coding-scheme=scheme
424 Add a CODINGSCHEME to the encoding. See ENCODINGS, below.
425
426 --warn-missing
427 Warn about encoded characters not supported by the font. See the
428 WARNMISSING command in ENCODINGS, below.
429
430 --literal-encoding=encoding
431 Select the dvips(1) encoding used for the font. No glyph substi‐
432 tutions will be permitted, so the output encoding will equal the
433 input encoding (and otftotfm will not generate an output encod‐
434 ing).
435
436 --base-encodings=file
437 Experts only. Allow the output font to refer to existing "base"
438 fonts. This can greatly reduce the number of base fonts generated
439 by otftotfm. Each line in the file argument contains a TeX font
440 name (as for --name) and a corresponding literal encoding file (as
441 for --literal-encoding); for example:
442 WarnoProReg--eka eka
443 WarnoProReg--exp1 exp1
444 The named fonts must have been created by prior runs of otftotfm
445 on the same input OpenType font, with the same --extend and
446 --slant options as the current run. The current output font will
447 refer to glyphs from the named base fonts when possible. If the
448 base fonts cover all glyphs required by the output font, otftotfm
449 won't generate any new base fonts at all. The file can also refer
450 to dotless-J fonts using the following syntax:
451 WarnoProReg--lcdfj - dotlessj
452
453 Automatic Mode Options
454 -a, --automatic
455 Select automatic mode.
456
457 -v vendor, --vendor=vendor
458 Set the font vendor name, which is used to locate files within the
459 TDS. Defaults to "lcdftools".
460
461 In automatic mode, TeX and friends will generally find required
462 font files independently of the vendor you select.
463
464 --typeface=typeface
465 Set the font typeface name, which is used to locate files within
466 the TDS. Defaults to the current font's family name with
467 unsuiable characters removed.
468
469 --no-type1
470 Do not use cfftot1(1) to create Type 1 fonts corresponding to the
471 OpenType input fonts.
472
473 --no-dotlessj
474 Do not use t1dotlessj(1) to create a special dotless-j font when
475 the input font doesn't have dotless-j.
476
477 --no-updmap
478 Do not run an updmap(1) program. This can be useful if you're
479 installing a bunch of fonts; it is much faster to run updmap once,
480 at the end, than to run it once per font.
481
482 --no-truetype
483 Do not install TrueType-flavored OpenType fonts.
484
485 Output Options
486 -n texname, --name=texname
487 Set the TeX name of the output font, which is used in font map
488 files and, in automatic mode, to generate the output filename.
489 The default is derived from the OpenType font's name and the fea‐
490 tures you selected.
491
492 -p, --pl
493 Output human-readable PL and VPL metrics, not binary TFM and VF
494 metrics. Note: Otftotfm's PL and VPL output files are legal, but
495 the fontinst program may not accept them (it has a picky parser).
496 Make sure to supply a --coding-scheme; if that doesn't help, run
497 the TFM output through tftopl(1).
498
499 --no-virtual
500 Do not generate virtual fonts (VFs and VPLs). Otftotfm will warn
501 if the selected font features cannot be implemented without vir‐
502 tual fonts.
503
504 --no-encoding
505 Do not generate an encoding file.
506
507 --output-encoding[=file]
508 Only generate an encoding file; do not generate any other output.
509 The encoding file is written to file, or to standard output if no
510 file argument is supplied.
511
512 --no-map
513 Do not generate a font map line for the font.
514
515 File Location Options
516 --tfm-directory=dir
517 --pl-directory=dir
518 --vf-directory=dir
519 --vpl-directory=dir
520 --encoding-directory=dir
521 --type1-directory=dir
522 --truetype-directory=dir
523 Set the directory used for various output types. Each directory
524 may be set by an environment variable, and defaults to a TDS
525 directory in automatic mode, or to "." otherwise. Environment
526 variable names and default TDS locations are described in the
527 Automatic Mode section above.
528
529 --map-file=filename
530 Set file in which otftotfm will write a font map line for the
531 font. The default is the standard output in manual mode, and
532 "TEXMF/fonts/map/dvips/vendor/vendor.map" (or "TEXMF/dvips/ven‐
533 dor/vendor.map" on older installations) in automatic mode.
534
535 Miscellaneous Options
536 --glyphlist=file
537 Use file as the Adobe glyph list, which helps translate glyph
538 names to Unicode code points. See ENCODINGS, below, for more
539 information.
540
541 -V, --verbose
542 Write progress messages to standard error.
543
544 --no-create
545 Do not create or modify any files. Instead, write messages about
546 the program's hypothetical progress to standard error.
547
548 --force
549 Generate all files, even if it looks like versions are already
550 installed.
551
552 -q, --quiet
553 Do not generate any error messages.
554
555 --kpathsea-debug=flags
556 Set path searching debugging flags. See the Kpathsea manual for
557 details.
558
559 -h, --help
560 Print usage information and exit.
561
562 --version
563 Print the version number and some short non-warranty information
564 and exit.
565
567 Otftotfm interprets encoding files as Unicode. For example, say an
568 input encoding has "/dotlessi" at position 10. Otftotfm detects that
569 position 10 should contain Unicode character U+0131 LATIN SMALL LETTER
570 DOTLESS I, and uses the font's glyph for that character (possibly modi‐
571 fied by any active features). The selected glyph might not be named
572 "dotlessi"; only the Unicode value matters.
573
574 Otftotfm assigns Unicode values to glyph names using a table published
575 by Adobe (SEE ALSO has a reference), with extensions for TeX. For more
576 fine-grained control, add UNICODING commands to the input encoding
577 file. These commands have the following format:
578 % UNICODING glyph =: choice1 [choice2 ...] ;
579 This tells otftotfm that the glyph named glyph translates into the
580 first Unicode value in the choice list that has a character in the
581 font. Glyph and the choices are PostScript glyph names; the initial
582 "%" sign is required; and each UNICODING line can contain multiple com‐
583 mands, separated by spaced semicolons. For example,
584 % UNICODING pi1 =: uni03D6 ;
585 encodes the character "/pi1" as U+03D6 GREEK PI SYMBOL, and
586 % UNICODING Delta =: uni0394 uni2206 ;
587 makes U+0394 GREEK CAPITAL LETTER DELTA preferred to U+2206 INCREMENT
588 as an encoding for "/Delta". You can also supply glyph names:
589 % UNICODING Delta =: Deltagreek Delta ;
590 A mapping with no Unicode values removes that glyph from the input
591 encoding. For instance, this erases any f-ligature characters from the
592 encoding:
593 % UNICODING ff =: ; fi =: ; fl =: ; ffi =: ; ffl =: ;
594 The slots are available for otftfm's own use, for example for other
595 characters required by the font. (If the f-ligatures themselves are
596 required by the font, for instance by a 'liga' feature, then they will
597 be stored into their old slots when possible.) Map a glyph to 'emptys‐
598 lot' if you don't want otftotfm to use the slot. For example, this
599 will leave the 'ff' slot unused if the font has no 'ff' glyph:
600 % UNICODING ff =: ff emptyslot ;
601 (Note that most OpenType fonts provide a visible representation for
602 unused encoding slots, namely a box with an X inside.)
603
604 LIGKERN comments in the encoding can add ligatures and inhibit kerns,
605 as in afm2tfm(1). To add a ligature, say:
606 % LIGKERN glyph1 glyph2 =: result ;
607 The "=:" operator indicates a normal ligature, where both the input
608 glyphs are removed and replaced by result. To preserve the left-hand
609 glyph, for an effect like "glyph1 glyph2 =: glyph1 result", use "|=:"
610 instead; to preserve the right-hand glyph, use "=:|". To remove all
611 kerns between two characters, say:
612 % LIGKERN glyph1 {} glyph2 ;
613 A "*" matches any character, so
614 % LIGKERN a {} * ;
615 removes all kerns with "a" as the left-hand character, and
616 % LIGKERN * {} * ;
617 removes all kerns.
618
619 Otftotfm also supports extended syntax for setting kern values and
620 inhibiting ligatures. To add an n-unit kern between two glyphs, say:
621 % LIGKERNX glyph1 {n} glyph2 ;
622 where n is an integer. This:
623 % LIGKERNX glyph1 {L} glyph2 ;
624 inhibits any ligature between glyph1 and glyph2. "{LK}" and "{KL}"
625 inhibit both ligatures and kerns.
626
627 You can set the --boundary-char and --altselector-char from an encoding
628 file with commands like this:
629 % LIGKERN || = boundarychar ;
630 % LIGKERNX ^^ = altselectorchar ;
631 As with UNICODING, each LIGKERN or LIGKERNX line can contain multiple
632 commands, separated by spaced semicolons.
633
634 Otftotfm has a default set of eight ligatures, namely:
635 space l =: lslash ; space L =: Lslash ;
636 question quoteleft =: questiondown ; exclam quoteleft =: exclamdown ;
637 hyphen hyphen =: endash ; endash hyphen =: emdash ;
638 quoteleft quoteleft =: quotedblleft ;
639 quoteright quoteright =: quotedblright
640 LIGKERN commands in the encoding file and --ligkern options can over‐
641 ride these defaults, or supply the --no-default-ligkern option to turn
642 them off.
643
644 The POSITION command shifts a glyph within its bounding box. The syn‐
645 tax is
646 % POSITION glyph pdx pdy adx ;
647 This will add pdx units of space to glyph's left edge; raise it up by
648 pdy units; and add adx units to its width. For example, to add 10
649 units of space to either side of the "T" glyph, supply
650 % POSITION T 10 0 20
651 To move the "degree" symbol up by 20 units, supply
652 % POSITION degree 0 20 0
653
654 The CODINGSCHEME command specifies the coding scheme for fonts using
655 this encoding. This is a string, less than 40 characters long and con‐
656 taining no parentheses, that classifies the encoding for TeX's pur‐
657 poses. Sample coding schemes include "TEX TEXT", "TEX MATH ITALIC",
658 and "EXTENDED TEX FONT ENCODING - LATIN". For example:
659 % CODINGSCHEME EXTENDED TEX FONT ENCODING - LATIN
660 Most tools ignore the coding scheme; fontinst is an exception.
661 Otftotfm uses the encoding's PostScript name for the default coding
662 scheme.
663
664 Finally, the WARNMISSING command makes any glyphs not supported by the
665 input font appear as black boxes. The dvips(1) processor will also
666 print a warning when encountering these glyphs. For example:
667 % WARNMISSING yes
668
669 The --unicoding, --ligkern, --position, --coding-scheme, and
670 --warn-missing options add UNICODING, LIGKERN/LIGKERNX, POSITION, COD‐
671 INGSCHEME, and WARNMISSING commands to an encoding, and can override
672 commands in the encoding itself. Some common encoding files have com‐
673 mands that are inappropriate for OpenType fonts; for example, "t1.enc"
674 hard-codes f-ligatures, which can cause problems with small-cap fonts.
675 Supply the --no-encoding-commands option to ignore all commands from
676 the encoding file. Commands from options like --ligkern are processed
677 in any case.
678
679 New Glyphs
680 New glyphs, such as ligatures and contextual substitutions, are added
681 to the encoding in any empty spaces, using their original locations
682 when possible. If the encoding doesn't have enough space for all new
683 glyphs, shorter ligatures composed of unaccented letters get prece‐
684 dence.
685
686 Synthetic Glyphs
687 Otftotfm can synthesize some glyphs using virtual font manipulations,
688 if a required glyph is not available in the input font. Specifically,
689 it will synthesize:
690
691 cwm TeX's compound word mark (a zero-width "strut"
692 rule with height equal to the font's x-height)
693 ascendercompwordmark "cwm" with height equal to the font's ascenders
694 capitalcompwordmark "cwm" with height equal to the font's capitals
695 visualspace A square cup used to represent spaces
696 dotlessj A dotless "j", synthesized with t1dotlessj(1)
697 dblbracketleft Kerned version of "[["
698 dblbracketright Kerned version of "]]"
699 bardbl The parallel symbol "||"
700 asteriskmath Vertically-centered "*"
701 ringfitted Ring accent centered on the width of "A"
702 twelveudash 2/3-em-wide dash
703 threequartersemdash 3/4-em-wide dash
704 centigrade "(degrees)C"
705 interrobang Combined "?!" symbol
706 interrobangdown Inverted interrobang
707 pertenthousand Per-ten-thousand sign (% with two extra 0s)
708 IJ "IJ" ligature
709 ij "ij" ligature
710 Germandbls "SS" (a capital sharp-s)
711 SSsmall Small-capital version of "SS"
712 FFsmall Small-capital version of "FF"
713 FIsmall Small-capital version of "FI"
714 FLsmall Small-capital version of "FL"
715 FFIsmall Small-capital version of "FFI"
716 FFIsmall Small-capital version of "FFL"
717
719 The --include-subs and --include-alternates options, and their
720 --exclude and --*-filter variants, accept the following types of pat‐
721 tern.
722
723 · Glyph names. Example: "Aacute". For PostScript-flavored fonts, use
724 otfinfo(1)'s -g option to see a font's glyph names, and "cfftot1
725 font.otf | t1testpage" to generate a PostScript file showing each
726 glyph.
727
728 · Glyph name patterns using the shell-style glob-matching rules: "*"
729 matches any number of characters, "?" matches any single character,
730 and "[...]" matches any character in a set. Example: "*.end".
731
732 · Unicode category properties in angle brackets. Examples: "<Let‐
733 ter>", "<UppercaseLetter>", "<Lu>". The complete list of both short
734 and long names: Letter/L, UppercaseLetter/Lu, LowercaseLetter/Ll,
735 TitlecaseLetter/Lt, ModifierLetter/Lm, OtherLetter/Lo; Number/N,
736 DecimalNumber/Nd, LetterNumber/Nl, OtherNumber/No; Punctuation/P,
737 ConnectorPunctuation/Pc, DashPunctuation/Pd, OpenPunctuation/Ps,
738 ClosePunctuation/Pe, InitialPunctuation/Pi, FinalPunctuation/Pf,
739 OtherPunctuation/Po; Symbol/S, MathSymbol/Sm, CurrencySymbol/Sc,
740 ModifierSymbol/Sk, OtherSymbol/So; Mark/M, SpacingMark/Mc, Enclos‐
741 ingMark/Me, NonspacingMark/Mn; Separator/Z, SpaceSeparator/Zs, Line‐
742 Separator/Zl, ParagraphSeparator/Zp; Other/C, Surrogate/Cs, For‐
743 mat/Cf, Control/Cc, PrivateUse/Co, Unassigned/Cn. Category values
744 current as of Unicode 4.0.
745
746 · Unicode ranges. Example: "U+007f-U+008C".
747
748 The "!" prefix negates a pattern, and you can separate multiple pat‐
749 terns by spaces.
750
752 This section lists features common to Western OpenType fonts and
753 describes how otftotfm handles them for common fonts. Please send the
754 author mail if otftotfm does not handle a feature you need, or you
755 believe it handles some feature incorrectly.
756
757 aalt, Access All Alternates
758 Lets the user choose between all available alternate forms for a
759 character. This includes things like superscript and subscript
760 variants, different styles (swash, for example), and even orna‐
761 ments. The --altselector-feature=aalt option can help an --altse‐
762 lector-char provide useful access to alternates, but the aalt fea‐
763 ture isn't usually useful on its own. Try the salt and calt fea‐
764 tures instead.
765 c2sc, Small Capitals From Capitals
766 Replaces capital letters with small capitals: a sort of converse
767 of the more conventional smcp feature, which replaces lower-case
768 letters with small capitals. Supported.
769 calt, Contextual Alternates
770 Lets the user choose between context-appropriate swash forms for
771 each character. For example, given the word "DREW" in a cursive
772 typeface, the "R E W" might be translated to calmer forms than the
773 initial "D". There may be more than one choice for a given let‐
774 ter, in which case the user should be able to select among them.
775 TeX can't support complex contextual alternates, or alternate
776 selection, but otftotfm supports some fonts quite well. The input
777 encoding should have lots of empty space for variants, and it
778 should specify a boundary character. See also cswh.
779 case, Case-Sensitive Forms
780 Shifts punctuation marks up to a position that works well with
781 all-capital-letter sequences. For example, the hyphen character,
782 which generally centers vertically on the x-height, is raised up
783 to center vertically on a capital letter. Also replaces text fig‐
784 ures with lining figures, and accent marks with forms more appro‐
785 priate for capitals. Supported.
786 cpsp, Capital Spacing
787 Adds a bit of space on either side of each capital letter. Sup‐
788 ported. (However, the OpenType tag registry suggests that cpsp be
789 on by default, but applying to all-caps text only; TeX cannot eas‐
790 ily implement that contextual intelligence.)
791 cswh, Contextual Swash
792 Lets the user choose between context-appropriate swash forms for
793 each character. For example, in the words "Ab AC", the first "A"
794 might be translated to a swash form, while the second might not.
795 There may be more than one choice for a given letter, in which
796 case the user should be able to select among them. Otftotfm sup‐
797 ports some fonts quite well. The input encoding should have lots
798 of empty space for swash variants, and it should specify a bound‐
799 ary character. See also calt and swsh.
800 dlig, Discretionary Ligatures
801 Activates uncommon ligatures, such as "c_t", "s_p", and "s_t".
802 Supported.
803 dnom, Denominators
804 Replaces digits and some punctuation marks with smaller forms sit‐
805 ting on the baseline, intended for fraction denominators. Sup‐
806 ported.
807 fina, Terminal Forms
808 Substitutes appropriate forms for letters occurring at the ends of
809 words. This feature doesn't select swash variants; it's intended
810 for normal use, and the specification recommends that it be on by
811 default. Partially supported: TeX will only treat spaces as the
812 ends of words, where a correct implementation would probably
813 include punctuation too. See cswh for selecting swash variants
814 active at the ends of words.
815 frac, Fractions
816 Replaces simple sequences like "1/2" with nice-looking fractions.
817 Supported, but beware: many fonts will translate "11/32" into "1"
818 + "1/3" + "2".
819 hist, Historical Forms
820 Replaces characters with historical variants. Usually, this means
821 at least translating regular "s" to long "s". Supported.
822 kern, Kerning
823 Adjusts the space between characters (pair kerning). Generally
824 supported, and you should probably turn it on. As a special case,
825 "-fkern" can also read kerning information from the "kern" table
826 in conventional TrueType fonts.
827 liga, Standard Ligatures
828 Activates common ligatures, such as "f_f", "f_i", "f_f_j", and (in
829 some Adobe fonts) "T_h". Generally supported, and you should
830 probably turn it on.
831 lnum, Lining Figures
832 Uses lining figures, the set of digits that are all about as high
833 as capital letters. Supported. Compare onum; see also pnum and
834 tnum.
835 numr, Numerators
836 Replaces digits and some punctuation marks with smaller, raised
837 forms intended for fraction numerators. Supported, but not usu‐
838 ally useful.
839 onum, Oldstyle Figures
840 Uses old-style figures, also known as text figures. This is the
841 set of digits that have ascenders and descenders like lower-case
842 letters. Supported. Compare lnum; see also pnum and tnum.
843 ordn, Ordinals
844 Designed for Spanish and French. Replaces ordinal numbers, such
845 as "2.o", with forms where the "o" is raised, and replaces the
846 sequence "No" with an integrated glyph. Supported.
847 ornm, Ornaments
848 Replaces some alphabetic characters in the font with ornaments,
849 and links the bullet character to a set of all bullet-like orna‐
850 ments, from which the user can choose. Partially supported: TeX
851 can handle alphabetic substitutions, but not bullet choice.
852 pnum, Proportional Figures
853 Digits will have different widths. Supported. Compare tnum; see
854 also lnum and onum.
855 salt, Stylistic Alternates
856 Lets the user choose between stylistic alternate forms for a char‐
857 acter. The --altselector-char mechanism provides useful access to
858 this feature. If you turn on salt globally, otftotfm takes the
859 first alternate form whenever there's more than one choice. See
860 also aalt and ss01; salt is generally more useful than aalt for
861 TeX, since it refers exclusively to stylistic alternates.
862 sinf, Scientific Inferiors
863 Replaces digits and some punctuation marks with smaller, lowered
864 forms intended for subscripts. Supported. Compare subs.
865 size, Optical Size
866 This feature stores information about the range of optical sizes
867 for which the font was intended. There is no point in selecting
868 it with otftotfm, since it should not change the font's appearance
869 in any way.
870 smcp, Small Capitals
871 Replaces lower-case letters with small capitals. Supported. Com‐
872 pare c2sc.
873 ss01-ss20, Stylistic Sets 1-20
874 Replaces characters with a uniform set of stylistic alternates.
875 Differs from features like salt in that a Stylistic Set is uni‐
876 form: an ssXX feature should never involve selection from a set of
877 possible alternate characters. Supported.
878 subs, Subscript
879 Replaces characters with smaller, lowered forms intended for sub‐
880 scripts. Supported. Compare sinf; some fonts support sinf but
881 not subs.
882 sups, Superscript
883 Replaces digits, some punctuation marks, and some lower-case let‐
884 ters with smaller, raised forms intended for superscripts. Sup‐
885 ported.
886 swsh, Swash
887 Activates all swash forms for each character. There may be more
888 than one swash form, in which case otftotfm will pick the first
889 one listed. Supported, except that swash variants other than the
890 first are inaccessible. Note that some fonts with swash variants
891 support the cswh feature exclusively.
892 tnum, Tabular Figures
893 All digits will have the same width, so that tables and the like
894 will align visually. Supported. Compare pnum; see also lnum and
895 onum.
896 zero, Slashed Zero
897 Replaces the zero character with a slashed zero. Supported.
898
900 no writable directory found in $TEXMF
901 Otftotfm could not find a writable directory in your $TEXMFVAR or
902 $TEXMF path. Did you create a $HOME/.texmf-var or $HOME/texmf
903 directory? If so, run the command "kpsewhich
904 --expand-path='$TEXMF'" to verify that directory is not being
905 found. You may need to set your TEXMF environment variable, to
906 '{!!'"$HOME"'/texmf,!!$TEXMFMAIN}', for instance (note the differ‐
907 ent kinds of quotes; on my machine, this expands to
908 '{!!/home/kohler/texmf,!!$TEXMFMAIN}').
909
910 'char' has no encoding, ignoring kern removal
911 (or ligature removal, lig/kern removal, or ligature)
912 These messages indicate a slight problem with your encoding file:
913 one of the LIGKERN commands referred to a character not present in
914 the encoding. This might be due to a misspelling in the LIGKERN
915 command or the encoding file, or it might be an oversight. Either
916 fix the encoding file or ignore the warning.
917
918 can't map 'char' to Unicode
919 Another encoding file problem: One of the glyph names in an UNI‐
920 CODING block could not be converted to Unicode. This is problem‐
921 atic since UNICODING exists wholly to translate glyph names into
922 Unicode. Fix the encoding file or ignore the warning.
923
924 not enough room in encoding, ignoring N glyph(s) ...
925 There wasn't space in the encoding for all the glyphs referred to
926 by the features you selected. For example, maybe the font had
927 more ligatures than there were empty slots in the encoding. Fix
928 this warning by selecting fewer features, or by using an encoding
929 with more empty slots, such as the 7t.enc encoding distributed
930 with otftotfm.
931
932 The '-a' option did not install my font correctly.
933 Try again with the '--verbose' option, which causes otftotfm to
934 explain its behavior. Note that by default, otftotfm will not re-
935 install files already present in your system's TeX search paths
936 (in the current directory, for instance). Use '--force' to over‐
937 ride this behavior.
938
940 How can I get a small-caps "SS" in place of the German sharp-S?
941 Supply the option '--unicoding "germandbls =: SSsmall"'.
942
943 How can I prevent f-ligatures from forming in a small-caps font?
944 This should happen automatically, but some overzealous encoding
945 files add f-ligatures even when the font doesn't request them.
946 Try the "--no-encoding-commands" option if this is a problem for
947 you.
948
949 Otftotfm seems to take a long time.
950 Use the -V option to see what it's doing. Often the culprit is
951 the updmap(1) program; if you're planning to run otftotfm multiple
952 times, give it the --no-updmap option and run updmap manually when
953 you're done.
954
955 How can I refer to the different forms of phi?
956 Otftotfm follows TeX practice and widely-distributed TeX encoding
957 vectors, so "/phi" in an input encoding vector should map to a
958 "straight" phi and "/phi1" should map to a "loopy" phi. Note that
959 TeX practice differs from the PostScript standard naming conven‐
960 tions, in which "/phi" is "loopy" and "/phi1" is "straight"; this
961 means that otftotfm may map "/phi" in an input encoding vector to
962 a font's "/phi1" glyph, and vice versa. Perhaps most unambigu‐
963 ously, you can use "/uni03D5" for the "straight" form and
964 "/uni03C6" for the "loopy" form.
965
966 How can I get lining figures (that is, normal line-height digits) with
967 small caps ('-fsmcp')?
968 Many fonts use old-style figures by default with small caps. Since
969 the default is not specified, it's wise to explicitly supply
970 '-flnum' or '-fonum'.
971
973 See the documentation for --pl above if you have problems running
974 otftotfm's output through fontinst.
975
977 pltotf(1), tftopl(1), vptovf(1), afm2tfm(1), dvips(1), cfftot1(1),
978 otfinfo(1), t1dotlessj(1), t1testpage(1), kpsewhich(1), updmap(1)
979
980 Adobe Type 1 Font Format
981
982 Adobe Technical Notes #5176, The Compact Font Format Specification, and
983 #5177, The Type 2 Charstring Format
984
985 OpenType Specification, Version 1.4
986
987 A Directory Structure for TeX Files, http://www.tug.org/tds/
988
989 Kpathsea: A library for path searching, http://www.tug.org/kpathsea/
990
991 Sivan Toledo, Exploiting Rich Fonts, TUGboat 21(2), 2000,
992 http://www.tug.org/TUGboat/Articles/tb21-2/tb67tole.pdf
993
994 Michel Goossens, Frank Mittelbach, and Alexander Samarin, The LaTeX
995 Companion (for information on the .fd file format)
996
997 Adobe Systems, "Unicode and Glyph Names". Refers to the glyphlist.txt
998 file used to translate glyph names to Unicode code points.
999 http://partners.adobe.com/public/developer/opentype/index_glyph.html
1000
1002 Eddie Kohler (ekohler@gmail.com)
1003
1004 Thanks to Karl Berry, Marco Kuhlmann, Adam Lindsay, Bruce D'Arcus,
1005 Thomas Esser, Claire Connelly, Nelson H.F. Beebe, and Ryuji Suzuki for
1006 suggestions, bug reports, and help. Particular thanks to Achim Blumen‐
1007 sath and Michael Zedler for suggestions and patches, some of them
1008 extensive.
1009
1010
1011
1012Version 2.80 LCDF Typetools OTFTOTFM(1)