Hi Werner and others, I've made some progress with the COLR v1 extension implementation in FreeType and would be happy to hear initial feedback on the general approach and API style. I am not requesting a full review yet, but I would be very happy if you had some time to take an initial high-level look. (Caveat: The code still has a set of TODOs and formatting needs tuning to follow the FreeType conventions more precisely).
I've added a set of FT_Paint_* / FT_COLR_* structures to freetype.h representing the primitives in the COLR v1 Gradients spec here: https://github.com/googlefonts/colr-gradients-spec/blob/master/colr-gradients-spec.md I've also added two new main entry points: FT_EXPORT ( FT_Bool ) FT_Get_Color_Glyph_Layer_Gradients ( FT_Face face, FT_UInt base_glyph, FT_UInt *aglyph_index, FT_COLR_Paint * paint, FT_LayerIterator *iterator ); For retrieval of the v1 layers, returning an FT_COLR_Paint union with solid, linear or radial gradient information depending on the union's format identifier. FT_EXPORT ( FT_Bool ) FT_Get_Colorline_Stops ( FT_Face face, FT_ColorStop * color_stop, FT_ColorStopIterator *iterator ); This methods work analogously to the layer retrieval functions for COLR v0 and v1, but defines a new ColorStopIterator to retrieve color stops of a gradient without requiring large client side allocations. I'm attaching git format-patch style patch on top of ToT, and you can also use https://github.com/drott/freetype2-colr/compare/master...colrV1ApiSquashed if you like for providing feedback. Thank you very much in advance for taking a look. I'll be out-of-office for two weeks but I'll respond to any feedback as soon as possible when getting back. Dominik On Tue, Jun 30, 2020 at 11:46 AM Dominik Röttsches <dr...@chromium.org> wrote: > > Hi Werner, > > thanks for the encouragement. > > On Tue, Jun 30, 2020 at 10:40 AM Werner LEMBERG <w...@gnu.org> wrote: > > > > In a team effort with Roderick Sheeter & Cosimo Lupo & Dave Crossland > > > (Google Fonts) and myself (Blink/Chrome) > > > > ... and Behdad Esfahbod ... > > Yes! > > > Thanks. Are there fundamental differences to the googledocs version at > > > > https://docs.google.com/document/d/1EPndWsdMK_M135FOIxQZ--dHpH727rXEBvLZqgIzZvs/edit?ts=5de68042#heading=h.no8g2ykeo8za > > I don't think there are major differences, we moved it to GitHub to > allow public comments and issue tracking. > > Dominik
0001-Draft-COLR-Table-v1-Gradient-Extensions-API-Proposal.patch
Description: Binary data