1OT2KPX(1) Marc Penninga OT2KPX(1)
2
3
4
6 ot2kpx - extract kerning information from OpenType fonts
7
9 ot2kpx fontfile
10
12 ot2kpx extract the kerning data from OpenType fonts (both otf and ttf
13 formats) and prints it (in afm format) to "stdout".
14
16 fontfile
17 The OpenType font (in either otf or ttf format).
18
20 - ot2kpx doesn't implement all of the OpenType specification. Things
21 that are missing include: support for font files containing
22 multiple fonts, LookupTables with LookupTypes other than 2, "kern"
23 tables with format other than 0 and ValueRecords with other types
24 of data than just XAdvance data.
25
26 Most of these limitations won't matter, since the missing features
27 are rare (the only fonts I know of that use them are the non-
28 western fonts that come with Adobe Reader). Furthermore, many of
29 these features define (according to the OpenType specification)
30 "subtle, device-dependent adjustments at specific font sizes or
31 device resolutions"; since there's no way to express such
32 adjustments in afm format, ignoring them seems to be the only
33 option anyway.
34
35 - ot2kpx collects kerning data first from the "kern" table, then from
36 all LookupTables associated with the "kern" feature; if a kerning
37 pair occurs multiple times, the first value seen is chosen. There
38 are (or may be) several issues with this approach:
39
40 - The OpenType specification says that fonts in otf format
41 shouldn't use the "kern" table at all, just the lookups from
42 the "GPOS" table. Many such fonts do, however, contain a
43 "kern" table, but no "GPOS" table; so we use the "kern" table
44 anyway.
45
46 - Instead of reading all LookupTables, it might be better to let
47 the user specify a script and language and process only the
48 LookupTables for those values. However, at least in the fonts
49 I checked, all script/language combinations eventually point to
50 the same "kern" LookupTables, so this approach wouldn't make
51 any difference (apart from further complicating the code).
52
54 Marc Penninga <marcpenninga@gmail.com>
55
57 Copyright (C) 2005-2013 Marc Penninga.
58
60 This program is free software; you can redistribute it and/or modify it
61 under the terms of the GNU General Public License as published by the
62 Free Software Foundation, either version 2 of the License, or (at your
63 option) any later version. A copy of the GNU General Public License is
64 included with ot2kpx; see the file GPLv2.txt.
65
67 This program is distributed in the hope that it will be useful, but
68 WITHOUT ANY WARRANTY; without even the implied warranty of
69 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
70 General Public License for more details.
71
73 (See the source code for the rest of the story.)
74
75 2013-08-07 Replaced all "given/when" constructions in the source code
76 by "if"'s, to avoid warnings about experimental features in
77 Perl 5.18 and later.
78
79 2012-02-01 Refactored the code, and fixed a number of bugs in the
80 process. Updated the documentation.
81
82
83
84fontools 2013-08-07 OT2KPX(1)