> I have implemented functionality to read the WOFF2 header, table
> directory and collection directory (if the font is a TTC), including
> most of the checks (given in the specification) in `sfwoff2.c' on
> the `GSoC-2019-nikhil' branch.
Nice!
> It would be *great* if you could review (and also test with a few
> font files :-) ) the code and provide feedback!
Will do that today or tomorrow, hopefully.
> * The code in function `woff2_open_font' is already (almost) 300
> lines. I believe it would be better to split it up into smaller
> functions (for instance, one for reading the table directory).
> Any thoughts?
This is up to you. If you can split the stuff into logical chunks
that are easier to understand, please do so. However, this is not a
necessity.
> * For TTC fonts, the `Collection Directory' specifies the index of
> tables that are part of each font in the collection. The
> `face_index' parameter in `FT_New_Face' specifies which face to
> load, so does that mean I can use that to directly extract and
> load only those tables that belong to the font on that index?
I think so, yes.
> Do I have to decompress each table and load the whole collection
> as an SFNT? I'm not sure...
Me neither, sorry. I have never worked with WOFF. Please report any
unclear issues to the WOFF2 standard team so that they can improve the
documentation.
> * I have written a few macros in `sfwoff2.c' to help with basic
> calculation and to allow implicit variables. Should I `#undef'
> these macros towards the end?
Well, I guess `sfwoff2.c' gets included with other .c files in
`sfnt.c', so it probably makes sense to undefine them, yes.
> * Is the code, in general, acceptable? Am I using the FT_* typedefs
> and macros correctly?
After a quick inspection, everything looks good, thanks! Don't worry
too much, you will get a better feeling for that stuff soon :-)
Werner
_______________________________________________
Freetype-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/freetype-devel