Fonttools: support STAT table

Created on 30 Sep 2016  路  7Comments  路  Source: fonttools/fonttools

enhancement

Most helpful comment

Behdad and I sat together this afternoon; it's now implemented.

All 7 comments

Working on it; give me another 1-2 days.

@brawer I have some unittests and some decompile code (since my trial with otData didn鈥檛 work).

I _really_ prefer everything new to go through otData.

@behdad, can you take over? The problem is that STAT needs new building blocks in otData, but (despite trying hard) neither me or Denis have been able to extend the framework. See https://github.com/fonttools/fonttools/commit/47d6aca5d7aafd61d45a106d5bc3812ccea9b85e for a cleaned-up attempt. The idea behind this LOffsetToArray(Foo) would be an offset to an array of Foo, where both the number of elements and the record size would come from the decoded table. I tried to implement this via tableDict[name + 'Count'] and tableDict[name + 'RecordSize'], but it never worked. You鈥檙e probably the only person on this planet who understands the framework well enough to extend it.

otData.py was written as an ad hoc solution to a very specific style of binary data (GSUB+GPOS). It relies on naming conventions and particular way of using offsets used in those tables. I don't know STAT yet, but I'm not surprised otData is hard to adapt to arbitrary other data structures. Originally, otData.py was actually generated from the MS html documentation. Sorry for being unhelpful here :(

But yeah, @behdad knows this code best these days, and perhaps it's an easy problem for him to solve :)

Behdad and I sat together this afternoon; it's now implemented.

Was this page helpful?
0 / 5 - 0 ratings