Skip to content

2021-08-02 Dominik Röttsches <drott@chromium.org>

Dominik Röttsches requested to merge drott/freetype:clipList into master

Add a new API FT_Get_ClipBox for retrieving an optional 'COLR' v1 glyph-specific clip box, which helps upstream graphics libraries allocate a sufficiently large bitmap for a glyph, without having to traverse glyph graph for that.

  • include/freetype/ftcolor.h (FT_Get_ClipBox): Add API to retrieve clip box, a newer addition to the 'COLR' v1 spec.
  • include/freetype/internal/sfnt.h (TT_Get_ClipBox_Func): Add function type and prepare pointer in SFNT interface.
  • src/base/ftobjs.c (FT_Get_ClipBox): Link API with SFNT implementation.
  • src/sfnt/sfdriver.c (PUT_COLOR_LAYERS_V1): Fill SFNT interface pointer with implementation in ttcolr.c.
  • src/sfnt/ttcolr.c (tt_face_load_colr): Parse global clip list offset. (tt_face_get_clipbox): Implement finding the clip box for a glyph id from the clip list array. Scale, transform, translate clipbox according to what is configured on FT_Face before returning.
  • src/sfnt/ttcolr.h (tt_face_load_colr): Add declaration.

Merge request reports