diff --git a/src/fonthx/opentype/BuildOptions.hx b/src/fonthx/opentype/BuildOptions.hx index b2d2da0..9d047c8 100644 --- a/src/fonthx/opentype/BuildOptions.hx +++ b/src/fonthx/opentype/BuildOptions.hx @@ -13,6 +13,7 @@ class BuildOptions { public var useFixedCoordinatesInCFF:Bool = false; public var useSubroutinesInCFF:Bool = false; + public var includeDeprecatedKERNTable:Bool = false; public var includeSVG:Bool = false; // todo general color config public var includeCOLR:Bool = false; public var sortGlyphs:Bool = true; diff --git a/src/fonthx/opentype/OpenTypeBuilder.hx b/src/fonthx/opentype/OpenTypeBuilder.hx index e0a304a..564e458 100644 --- a/src/fonthx/opentype/OpenTypeBuilder.hx +++ b/src/fonthx/opentype/OpenTypeBuilder.hx @@ -95,11 +95,13 @@ class OpenTypeBuilder { ttf.addTable(createHorizontalMetricsTable(font)); if (font.hasKerning()) { - var numPairs = font.getKerningPairs().length; - if (numPairs > 10919) { // (((256 * 256) - 18) / 6); - trace('Too many kerning pairs ${numPairs}. KERN table will overflow. No KERN table will be written'); - } else { - ttf.addTable(createKerningTable(font)); + if (options.includeDeprecatedKERNTable) { + var numPairs = font.getKerningPairs().length; + if (numPairs > 10919) { // (((256 * 256) - 18) / 6); + trace('Too many kerning pairs ${numPairs}. KERN table will overflow. No KERN table will be written'); + } else { + ttf.addTable(createKerningTable(font)); + } } ttf.addTable(createGPOSTable(font)); }