Extending GSUB of existing font using features file

I have an existing font (.ttf or as dumped .ttx) that I want to extend with additional GSUB rules. I wanted to work with an AFDKO feature file, so I created a UFO, and filled a features.fea with my desired substitutions. The UFO has dummy placeholder glyphs as the existing font glyphs should be used. The UFO compiles nicely and the GSUB rules are working.

I am now looking for a way to properly merge this with the existing font, which already has a GSUB table.

What I tried:
  • Dumping the new GSUB table and use ttx to merge it in the existing font (doesn't work, existing GSUB gets overwritten instead of merged)
  • Manually transplanting the new GSUB table, updating indexes etc. with a simple script. Works, but feels hacky.

What I think might work but feels too nasty to actually do:
  • Dump the existing .ttf to UFO, add new GSUB rules, compile UFO back to .ttf.
Any advice on a cleaner way?

Comments

  • > Manually transplanting the new GSUB table, updating indexes etc. with a simple script. Works, but feels hacky.

    This seems to be the safest route. Decompiling the existing GPOS to fea might break things.
  • This sounds like a job for DTL OTMaster.

    André
  • Kent Lew
    Kent Lew Posts: 944
    edited July 2019
    I suppose you could do what you suggest and dump the existing.ttf to UFO, add new GSUB rules, compile UFO back to .ttf . . . but then, to get around what Georg cautions (which I agree with), you could dump the new .ttf to .ttx to get the newly compiled, merged GSUB table and insert that back into the original .ttf.
    That way, you utilize a compiler to get the new updated GSUB, instead of manual work, but you maintain everything else from the original intact.
  • Thanks for the suggestions! I think I'll stick to the custom script for now.

    @Kent Lew That's sounds like a relatively clean way to do something dirty. Will keep that in mind as a second option!