Skip to content
Myr

Allowing Compound Glyphs with `numberOfContours < -1`

Before adoption: this commit came in with the history the project adopted, so no landing records it.

While it is recommended that the numberOfContours are set to -1 for compound glyphs, it is allowed to have any negative value. Source: https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6glyf.html However, I don't know if this happens in practice.

authored by Brotcrunsher · committed by GitHub · parent 2c2908f · Browse files · 1 file+1 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−4 removed

  • other:+1 added−4 removed

1 file+1 added−4 removed

modified:stb_truetype.h+1 added-4 removed
1755 unmodified lines
1756 }1757 }1758 }1759 num_vertices = stbtt__close_shape(vertices, num_vertices, was_off, start_off, sx,sy,scx,scy,cx,cy);1760 } else if (numberOfContours == -1) {1760 } else if (numberOfContours < 0) {1761 // Compound shapes.1762 int more = 1;1763 stbtt_uint8 *comp = data + g + 10;1764 num_vertices = 0;
68 unmodified lines
1833 }1834 // More components ?1835 more = flags & (1<<5);1836 }1837 } else if (numberOfContours < 0) {1838 // @TODO other compound variations?1839 STBTT_assert(0);1837 } else {1838 // numberOfCounters == 0, do nothing1839 }1840
3039 unmodified lines