WOFF and padding at the end of the font file

Looking at some OpenType font files I noticed that they include padding bytes after last table. I checked John Daggets's web fonts page (http://people.mozilla.org/~jdaggett/webfonts/fonts/), there are at least two of them having this issue: Chunkfive.otf and MEgalopolisExtra.otf. I do not see such fonts shipped with Windows, but digging more into this I found at least two font tools I am using, that are inserting this unnecessary padding.

"OpenType Font File" section of OpenType specification says: "All tables must begin on four byte boundaries, and any remaining space between tables is padded with zeros." There is nothing there about padding after last table. This would be ok, nobody is looking there anyway :). But, this makes exact recreation of original font file from WOFF impossible. Only way to get actual length of unpacked font is to add offset of the last table and its length. But this will give you size without padding applied after it, so it will not match length of original file specified in WOFF header.

How should we deal with this? Three options I can see: amending WOFF spec to allow up to 3 bytes of padding after last table, ask WOFF creation tools to reject files with extra padding (I do not know how many fonts will actually be affected) or adjust total unpacked length in WOFF header to exclude extra padding from original file length (although unpacking this will not result in original font file).

Thoughts?

Thanks,
Sergey

Received on Tuesday, 8 June 2010 22:57:03 UTC