Author Topic: Optimizing old-style "kern" table kerning export  (Read 1401 times)

Adam Twardoch (FontLab)

  • Product and marketing manager, Fontlab Ltd.
  • Administrator
  • Hero Member
  • *****
  • Posts: 563
  • FontLab Studio 5.1.2, Mac OS X 10.6.8
    • FontLab
Optimizing old-style "kern" table kerning export
« on: 2013-09-10, 00:42:03 »
If you're building large fonts with many glyphs and would like to generate them as OpenType TT / TrueType (.ttf), it still makes sense to include both the OpenType "GPOS" table and the old-style TrueType "kern" table kerning. However, the old-style "kern" table kerning should not contain any kerning pairs that involve unencoded glyphs, since these glyphs will only be available through OpenType Layout features, and if an application supports OpenType Layout, it will use the "GPOS" kerning anyway.

FontLab Studio 5.x does not have a built-in mechanism to automatically exclude unencoded glyphs from the "kern" table, but here's a simple workaround.

1. Download unicode62.zip, unzip it and and place the included codepage62.cpg file in the the "Codepage" folder within your FontLab shared data folder.

Unless you're using a custom location of the data folders, the Codepage folder would be [your user home folder]/Library/Application Support/FontLab/Codepage on Mac OS X, and C:\Documents and Settings\Your Username\My Documents\FontLab\Shared\Codepage on Windows.

2. Restart FontLab Studio.

3. Open Preferences (or Tools / Options), navigate to Generating OpenType & TrueType / Kerning.

4. Make the settings as follows:
* enable "Export old-style non-OpenType "kern" table"
* enable "Expand class kerning while building [kern] table"
* enable "Generate only pairs with glyphs in following codepage"
* choose "Unicode 6.2 BMP characters" from the dropdown menu
* enable "Limit total number of pairs in the table to"
* enter "10920" into the text box.

You may enable "Generate OpenType "kern" feature if it is undefined or outdated — FLS will then override your "kern" feature as defined in the OpenType panel, i.e. it will always use the information from Metrics Window and the Classes panel. If you disable this option, FLS will not touch your existing "kern" feature definition — useful if you're using KLTF Make Kern Feature or Metrics Machine. However, the contents of the "kern" table will always be created using the Metrics Window / Classes panel information.

The 10920 limit is the maximum limit for one subtable. If you disable it, FLS may generate additional "kern" subtables but that's not recommended as it's not supported by Microsoft.

With the "Unicode 6.2 BMP characters" option, a very large font will only have some 9,000 kerning pairs in the "kern" table, while without it, it would have over a 1,000,000. So it's definitely worth trying.

Note: TransType 4 and the upcoming next-generation FontLab Studio do all this automatically, of course.

Regards,
Adam Twardoch
Fontlab Ltd.
« Last Edit: 2013-09-10, 00:45:30 by Adam Twardoch (FontLab) »
Regards,
Adam Twardoch
Fontlab Ltd.