For PDF font embedding purposes, I have been tasked with removing glyph outline data for unused glyphs from a CFF OpenType file to reduce its size.
The problem is that unlike TTF, CFF "compresses" into subroutines its glyph outline data and creates dependencies between glyphs and I can't just remove the glyph and its matching char from cmap and outline data.
Since there are several open source CFF libraries like otfcc that can subroutinize a CFF file, I was wondering if there are libraries that can do the opposite and undo subroutinizing.
UPDATE: The library I'm using are otfcc and sfntly. Sfntly doesn't have a CFF parser so I'm extending one, otfcc do have one, but doesn't seem to have a subset option, the source looks more promising though. I also looked at freetype, and whilst it does have CFF loader, doesn't seem to have a subsetter.
I'm currently halfway done porting fontbox for pdfbox from Apache to sfntly. The parser works, but subsetter is still incomplete.
In the end I ended up using AFDKO, I didn't realize it was open source! It have everything from subsetting CFF to using it to make otf font.