HarfBuzz Study: Subsetter

HarfBuzz Study: Subsetter Behdad Esfahbod & Garret Rieger 9 April 2025 [Comments welcome on GoogleDocs] Introduction Requirements Other subsetters Prior papers and presentations Design Read/write instead of decompile/modify/compile Input specification Subset Planning and Execution Glyph closure...

Google Docs
@behdad Very interesting! To be honest, I am reading the docs to see if there's a way, from shaped text (= a list of GIDs) to subset the font, but also map back to Unicode (i.e. glyphs that have Unicode code points, but also glyphs that wouldn't and would need e.g. to be re-mapped to private area), for use of that subset/remapped font in a browser. Any additional pointers?
@omikhleia It has been done for sure. We don't currently have a ready-made tool for it. You would need to cut a subset retaining the gid's you want, then modify the cmap to add extra PUA mappings to it. If speed is not an issue, you can do this on top of `fonttools subset` via Python API easily.