On Thu, 22 Aug 2013 09:22:00 +0200 (CEST) Werner LEMBERG wrote: > > For a couple of my projects, I need to retrieve a list of all > > kerning pairs defined in the KERN table (subtable format 0). (I'm > > populating externally-defined API data structures which require it.) > > Sounds very inefficient.
Unfortunately, yes; I am caching the information to an extent, though. > > If anyone knows where I can find a sample of such a (TrueType) font, > > I'd appreciate it. (That's question #1.) > > Given that it essentially affects old Apple fonts only you probably > might ignore format 2 completely. Modern fonts don't have `kern' (or > probably just a rudimentary version covering the most basic needs) but > `GPOS'. However, in case you find one I would like to have it > also :-) OK, fair enough. It's not so much the type 2 format as my code's ability to parse over multiple subtables of any type that I'd like to test if possible. I wonder if FontForge can generate such a beast? > Having such a large table is indeed against the specification. > However, it *might* work, depending on the strictness of the > implementation: If there is only a single subtable, the actual value > of the `length' field is basically unimportant. Of course, the right > solution is to split into a set of smaller subtables. I've decided to basically ignore the length field (except when skipping past non-format-0 subtables, at least for now) and calculate it myself based on the number of pairs in the table. I can also check to make sure I'm not running past the end of the entire kerning directory. At least it seems to work, at least with what I have. :) Thanks. -- Alex Taylor <[email protected]> http://www.altsan.org _______________________________________________ Freetype mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/freetype
