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

  • Georg SeifertGeorg Seifert Posts: 587
    > 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 LewKent Lew Posts: 900
    edited July 30
    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.
  • Roel NieskensRoel Nieskens Posts: 128
    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!
Sign In or Register to comment.