OT2KPX(1)
π NAME π
okay so bestie, this is OT2KPX(1) β the manual page for ot2kpx, the little Unix cutie that extracts kerning information from OpenType fonts. β¨
πΈ SYNOPSIS πΈ
the whole mood, in one line:
ot2kpx [ -afm | -kpx | -lua ] <fontfile>
β¨ DESCRIPTION β¨
ot2kpx pulls the kerning data out of OpenType fonts and prints it to stdout, either in Adobe's KPX format (for adding to an afm file) or as a Luatex custom feature, for use with the \directlua command. no cap, that's the whole vibe. π
π OPTIONS AND ARGUMENTS π
here's the flag situation, bestie:
-helpβ print a short help text and exit. π«Ά-versionβ printot2kpx's version and exit. π-afm,-kpxβ output the kerning data in Adobe'sKPXformat, as used inafmfiles. this is the default output format. β-luaβ output the kerning data as aLuatexcustom font feature, to be included in a\directluacommand. π¦<fontfile>β the OpenType font (bothotfandttfformat are supported). π
π«Ά RESTRICTIONS π«Ά
okay, real talk, there are some limits:
ot2kpxdoesn't implement all of the OpenType specification. things that are missing include: support for font files containing multiple fonts, LookupTables with LookupTypes other than 2,kerntables with format other than 0 and ValueRecords with other types of data than just XAdvance data.
most of these limitations won't matter, since the missing features are rare (the only fonts I know of that use them are the non-western fonts that come with Adobe Reader). furthermore, many of these features define (according to the OpenType specification) "subtle, device-dependent adjustments at specific font sizes or device resolutions"; since there's no way to express such adjustments in afm format, ignoring them seems to be the only option anyway. π
ot2kpxcollects kerning data first from thekerntable, then from all LookupTables associated with thekernfeature; if a kerning pair occurs multiple times, the first value seen is chosen. there are (or may be) several issues with this approach:- the OpenType specification says that fonts in
otfformat shouldn't use thekerntable at all, just the lookups from theGPOStable. many such fonts do, however, contain akerntable, but noGPOStable; so we use thekerntable anyway. π - instead of reading all LookupTables, it might be better to let the user specify a script and language and process only the LookupTables for those values. however, at least in the fonts I checked, all script/language combinations eventually point to the same
kernLookupTables, so this approach wouldn't make any difference (apart from further complicating the code). π
- the OpenType specification says that fonts in
π AUTHOR π
Marc Penninga <marcpenninga@gmail.com> π
π COPYRIGHT π
Copyright (C) 2005-2026 Marc Penninga. π
π¦ LICENSE π¦
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. a copy of the GNU General Public License is included with ot2kpx; see the file GPLv2.txt. slay. π
β DISCLAIMER β
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. β
π VERSION π
This document describes ot2kpx version 20260210. π
π₯ RECENT CHANGES π₯
(See the source code for the rest of the story.) π
2019-05-20β Added the-versionoption.2019-04-15β Added the-luacommand-line option to get output inLuatex's custom feature format.
mwah π β this page is OT2KPX(1) from fontools, dated 2026-02-10. π
π¦ where this page comes from
- alpine 3.24: texmf-dist-fontutils-doc 2026.0-r0 Β· LPPL-1.0 AND LPPL-1.1 AND LPPL-1.2 AND LPPL-1.3a AND LPPL-1.3c AND GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms