[Glyph] Only treat numContours=-1 as Composite

Leave the other negative numbers as empty glyph.
pull/4218/head
Behdad Esfahbod 2 years ago
parent db23be642f
commit 2f9945ca01
  1. 3
      src/OT/glyf/Glyph.hh

@ -555,10 +555,11 @@ struct Glyph
int num_contours = header->numberOfContours;
if (unlikely (num_contours == 0)) type = EMPTY;
else if (num_contours > 0) type = SIMPLE;
else if (num_contours == -1) type = COMPOSITE;
#ifndef HB_NO_VAR_COMPOSITES
else if (num_contours == -2) type = VAR_COMPOSITE;
#endif
else type = COMPOSITE; /* negative numbers */
else type = EMPTY; // Spec deviation; Spec says COMPOSITE, but not seen in the wild.
}
protected:

Loading…
Cancel
Save