|
From: James C. <cl...@jh...> - 2013-04-26 21:22:12
|
>>>>> "AT" == Aaron Turner <aar...@ma...> writes: AT> I have a large number of fonts (all downloaded from "copyleft" sources AT> such as Google fonts, SIL, etc) and I wish to use Fontforge/Python to AT> generate specific Unicode subsets of these fonts, for WOFF / @font-face AT> purposes. I'd take a look at cairo's code for subsetting. Perhaps also pdftex and/or luatex. Of course, there are some table those projects do not need to emit which you will need to, so they can only be a starting point. The problem boils down to creating a graph of how each entry of each table interacts, weeding out what you do not want, and saving the rest. After forming the graph, mark each needed node starting with the char- acters you want, and recusively drilling down a la find(1) to every node which those nodes depend on (glyphs, GPOS, GSUB, et al). As the tables shrink, the IDs and offsets of their contents change; you have to keep track of those changes. You might find some ideas for this step from tree-based filesystems like btrfs and tux3. Even if you use fontforge (or libfontforge) to do everything to ff's sfd representation, I suspect you'll still need to keep track of renumbering once you know what you want to keep and elide. -JimC -- James Cloos <cl...@jh...> OpenPGP: 1024D/ED7DAEA6 |