google / google/woff2

Glyf table point flags bit 6 gets lost

Open
#117 16 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
1.8k
Forks
228
PR merge metrics
No merged PRs in 30d

Description

Compressing a TTF to WOFF2 ignores bit 6 of any glyf table point flags. This bit is marked as reserved in the OT spec, but Apple uses it to determine the presence of overlapping contours in a glyph. See https://github.com/fonttools/fonttools/issues/730 and https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6AATIntro.html:

> For simple glyphs, you should set bit 6 of the first Outline Flag byte to 1 if the unhinted glyph outline has overlapping contours or if variation controls or hinting controls can ever cause any of the contours to overlap. Otherwise this bit should be set to 0.

Should the woff2_compress code be patched so the flag stays intact? I don’t have the experience in C to do it myself.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.