opentype.js icon indicating copy to clipboard operation
opentype.js copied to clipboard

Trying to subset fontawesome v6 - extended ligature lookup table not supported

Open danielgindi opened this issue 3 years ago • 2 comments
trafficstars

I'm trying to subset FA's v6 files, by creating a new font, copying over the glyphs, reading the ligature lookup tables and mapping to new lookup tables in the new font.

Expected Behavior

Copy over the glyphs and their ligatures easily, generate a valid ttf.

Current Behavior

In any way I tried, an invalid font is generated.

Possible Solution

Steps to Reproduce (for bugs)

First, the builtin function getLigatures() only looks for lookupType=4, and not 7 which is "extended". So I tried using getLookupTables, and mapping the ligature's indexes to the new indexes. I get a good looking lookup table after using addLigature on the new font. Writing to a file - I get an invalid font. Probably because the glyphs are in a very high unicode area. So I tried to mutate the generated lookup table to a lookupType of 7, and wrap the subtable in "extended" like the parser does. Turns out - there is no "maker" for type 7, only parser. I tried writing a small maker for it based on the parser's config, but I still get an invalid ttf file.

Your Environment

  • Version used: 1.3.4
  • Font used: Font Awesome Pro v6
  • Operating System and version (desktop or mobile): Windows 10

danielgindi avatar Feb 20 '22 20:02 danielgindi

seems related to: https://github.com/opentypejs/opentype.js/pull/486

yne avatar Apr 21 '22 21:04 yne

seems related to: #486

That PR only adds parsing support, writing support is a different story and I just added #561 so we can keep track of this.

Connum avatar Feb 11 '23 22:02 Connum