| 1 |
.\" -*- mode: troff; coding: utf-8 -*- |
| 2 |
.\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45) |
| 3 |
.\" |
| 4 |
.\" Standard preamble: |
| 5 |
.\" ======================================================================== |
| 6 |
.de Sp \" Vertical space (when we can't use .PP) |
| 7 |
.if t .sp .5v |
| 8 |
.if n .sp |
| 9 |
.. |
| 10 |
.de Vb \" Begin verbatim text |
| 11 |
.ft CW |
| 12 |
.nf |
| 13 |
.ne \\$1 |
| 14 |
.. |
| 15 |
.de Ve \" End verbatim text |
| 16 |
.ft R |
| 17 |
.fi |
| 18 |
.. |
| 19 |
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. |
| 20 |
.ie n \{\ |
| 21 |
. ds C` "" |
| 22 |
. ds C' "" |
| 23 |
'br\} |
| 24 |
.el\{\ |
| 25 |
. ds C` |
| 26 |
. ds C' |
| 27 |
'br\} |
| 28 |
.\" |
| 29 |
.\" Escape single quotes in literal strings from groff's Unicode transform. |
| 30 |
.ie \n(.g .ds Aq \(aq |
| 31 |
.el .ds Aq ' |
| 32 |
.\" |
| 33 |
.\" If the F register is >0, we'll generate index entries on stderr for |
| 34 |
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index |
| 35 |
.\" entries marked with X<> in POD. Of course, you'll have to process the |
| 36 |
.\" output yourself in some meaningful fashion. |
| 37 |
.\" |
| 38 |
.\" Avoid warning from groff about undefined register 'F'. |
| 39 |
.de IX |
| 40 |
.. |
| 41 |
.nr rF 0 |
| 42 |
.if \n(.g .if rF .nr rF 1 |
| 43 |
.if (\n(rF:(\n(.g==0)) \{\ |
| 44 |
. if \nF \{\ |
| 45 |
. de IX |
| 46 |
. tm Index:\\$1\t\\n%\t"\\$2" |
| 47 |
.. |
| 48 |
. if !\nF==2 \{\ |
| 49 |
. nr % 0 |
| 50 |
. nr F 2 |
| 51 |
. \} |
| 52 |
. \} |
| 53 |
.\} |
| 54 |
.rr rF |
| 55 |
.\" |
| 56 |
.\" Required to disable full justification in groff 1.23.0. |
| 57 |
.if n .ds AD l |
| 58 |
.\" ======================================================================== |
| 59 |
.\" |
| 60 |
.IX Title "OT2KPX 1" |
| 61 |
.TH OT2KPX 1 2026-04-22 fontools "Marc Penninga" |
| 62 |
.\" For nroff, turn off justification. Always turn off hyphenation; it makes |
| 63 |
.\" way too many mistakes in technical documents. |
| 64 |
.if n .ad l |
| 65 |
.nh |
| 66 |
.SH NAME |
| 67 |
ot2kpx \- extract kerning information from OpenType fonts |
| 68 |
.SH SYNOPSIS |
| 69 |
.IX Header "SYNOPSIS" |
| 70 |
\&\fBot2kpx\fR [ \fI\-afm\fR | \fI\-kpx\fR | \fI\-lua\fR ] \fB<fontfile>\fR |
| 71 |
.SH DESCRIPTION |
| 72 |
.IX Header "DESCRIPTION" |
| 73 |
\&\fBot2kpx\fR extract the kerning data from OpenType fonts and prints it |
| 74 |
to \f(CW\*(C`stdout\*(C'\fR, either in Adobe\*(Aqs KPX format (for adding to an \fIafm\fR file) |
| 75 |
or as a Luatex custom feature, for use with the \f(CW\*(C`\edirectlua\*(C'\fR command. |
| 76 |
.SH "OPTIONS AND ARGUMENTS" |
| 77 |
.IX Header "OPTIONS AND ARGUMENTS" |
| 78 |
.IP \fB\-help\fR 4 |
| 79 |
.IX Item "-help" |
| 80 |
Print a short help text and exit. |
| 81 |
.IP \fB\-version\fR 4 |
| 82 |
.IX Item "-version" |
| 83 |
Print \fBot2kpx\fR\*(Aqs version and exit. |
| 84 |
.IP "\fB\-afm\fR, \fB\-kpx\fR" 4 |
| 85 |
.IX Item "-afm, -kpx" |
| 86 |
Output the kerning data in Adobe\*(Aqs KPX format, as used in \fIafm\fR files. |
| 87 |
This is the default output format. |
| 88 |
.IP \fB\-lua\fR 4 |
| 89 |
.IX Item "-lua" |
| 90 |
Output the kerning data as a Luatex custom font feature, |
| 91 |
to be included in a \f(CW\*(C`\edirectlua\*(C'\fR command. |
| 92 |
.IP \fB<fontfile>\fR 4 |
| 93 |
.IX Item "<fontfile>" |
| 94 |
The OpenType font (both \fIotf\fR and \fIttf\fR format are supported). |
| 95 |
.SH RESTRICTIONS |
| 96 |
.IX Header "RESTRICTIONS" |
| 97 |
.IP \fB\-\fR 4 |
| 98 |
.IX Item "-" |
| 99 |
\&\fBot2kpx\fR doesn\*(Aqt implement all of the OpenType specification. |
| 100 |
Things that are missing include: support for font files containing |
| 101 |
multiple fonts, LookupTables with LookupTypes other than 2, |
| 102 |
"kern" tables with format other than 0 and ValueRecords with |
| 103 |
other types of data than just XAdvance data. |
| 104 |
.Sp |
| 105 |
Most of these limitations won\*(Aqt matter, since the missing features |
| 106 |
are rare (the only fonts I know of that use them are the non\-western fonts |
| 107 |
that come with Adobe Reader). Furthermore, many of these features define |
| 108 |
(according to the OpenType specification) \fI"subtle, device\-dependent |
| 109 |
adjustments at specific font sizes or device resolutions"\fR; |
| 110 |
since there\*(Aqs no way to express such adjustments in \fIafm\fR format, |
| 111 |
ignoring them seems to be the only option anyway. |
| 112 |
.IP \fB\-\fR 4 |
| 113 |
.IX Item "-" |
| 114 |
\&\fBot2kpx\fR collects kerning data first from the "kern" table, then from |
| 115 |
all LookupTables associated with the "kern" feature; if a kerning pair |
| 116 |
occurs multiple times, the first value seen is chosen. |
| 117 |
There are (or may be) several issues with this approach: |
| 118 |
.RS 4 |
| 119 |
.IP \- 4 |
| 120 |
The OpenType specification says that fonts in \fIotf\fR format shouldn\*(Aqt |
| 121 |
use the "kern" table at all, just the lookups from the "GPOS" table. |
| 122 |
Many such fonts do, however, contain a "kern" table, but no "GPOS" table; |
| 123 |
so we use the "kern" table anyway. |
| 124 |
.IP \- 4 |
| 125 |
Instead of reading all LookupTables, it might be better to let the user |
| 126 |
specify a script and language and process only the LookupTables for |
| 127 |
those values. |
| 128 |
However, at least in the fonts I checked, all script/language combinations |
| 129 |
eventually point to the \fIsame\fR "kern" LookupTables, so this approach |
| 130 |
wouldn\*(Aqt make any difference (apart from further complicating the code). |
| 131 |
.RE |
| 132 |
.RS 4 |
| 133 |
.RE |
| 134 |
.SH AUTHOR |
| 135 |
.IX Header "AUTHOR" |
| 136 |
Marc Penninga <[email protected]> |
| 137 |
.SH COPYRIGHT |
| 138 |
.IX Header "COPYRIGHT" |
| 139 |
Copyright (C) 2005\-2026 Marc Penninga. |
| 140 |
.SH LICENSE |
| 141 |
.IX Header "LICENSE" |
| 142 |
This program is free software; you can redistribute it and/or modify |
| 143 |
it under the terms of the GNU General Public License as published |
| 144 |
by the Free Software Foundation, either version 2 of the License, |
| 145 |
or (at your option) any later version. |
| 146 |
A copy of the GNU General Public License is included with \fBot2kpx\fR; |
| 147 |
see the file \fIGPLv2.txt\fR. |
| 148 |
.SH DISCLAIMER |
| 149 |
.IX Header "DISCLAIMER" |
| 150 |
This program is distributed in the hope that it will be useful, |
| 151 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 152 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 153 |
See the GNU General Public License for more details. |
| 154 |
.SH VERSION |
| 155 |
.IX Header "VERSION" |
| 156 |
This document describes \fBot2kpx\fR version 20260422. |
| 157 |
.SH "RECENT CHANGES" |
| 158 |
.IX Header "RECENT CHANGES" |
| 159 |
(See the source code for the rest of the story.) |
| 160 |
.IP \fI2019\-05\-20\fR 12 |
| 161 |
.IX Item "2019-05-20" |
| 162 |
Added the \fI\-version\fR option. |
| 163 |
.IP \fI2019\-04\-15\fR 12 |
| 164 |
.IX Item "2019-04-15" |
| 165 |
Added the \fI\-lua\fR command\-line option to get output in Luatex\*(Aqs |
| 166 |
custom feature format. |