Hi, the utility program ttf2svg crashes when converting fonts from Font Freak (ie http://www.fontfreak.com/fonts/a/Anagram.zip). It seems that during the decoding step of the Os2 table that some fields are optionals and depend on the version of the table (I took the information from FreeType2 web site http://freetype.sourceforge.net/freetype2/docs/reference/ft2-truetype_tables.html#TT_OS2) I attached a patch which take care of the version of the table. I used version 1.8pre but the bug is also present in SVN. Regards, Ludovic
Created attachment 22187 [details] Patch of OS2 Font Table
I've analyzed the patch and, from the link [1], the only things that is not clear to me is if versions are backwards compatible, that is, if a version 2 font includes all version 1 information. The documentation says "only version X tables", something which confuses (me) a bit. So, my doubt is if: + if (version >= 1) { Should be: + if (version == 1) { Naturally, the same poses for the version 2 check. Apart from this, this seems good to me. A (commented) link to the documentation within the patch would also sound reasonable to further support the version-specific handling. :-) [1] http://freetype.sourceforge.net/freetype2/docs/reference/ft2-truetype_tables.html#TT_OS2
I found a more complete (and more official?) documentation than the FreeType one. From [1], all 4 versions of the OS/2 table are presented and they are all backward compatible. The patch could also include the extra fields in to support version 2 and 3. [1] http://www.microsoft.com/typography/OTSpec/os2.htm
Adding the "[PATCH] " prefix to the summary for coherency with other bugs with patches available (although the "PatchAvailable" keyword can also be used, so this is somehow redundant).