Skip to content

Commit

Permalink
Merge pull request #1213 from googlefonts/fix-normalize-contours
Browse files Browse the repository at this point in the history
[ttx_diff] put normalized `<contour>` elements first, before `<instructions>`
  • Loading branch information
anthrotype authored Jan 23, 2025
2 parents 51e9464 + 13e2dc3 commit 623edcd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions resources/scripts/ttx_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,10 +387,14 @@ def normalize_glyf_contours(ttx):
normalized = sorted(contours, key=to_xml_string)
if normalized == contours:
continue
# normalized contours should be inserted before any other TTGlyph's
# subelements (e.g. instructions)
for contour in contours:
glyph.remove(contour)
for contour in normalized:
glyph.append(contour)
non_contours = list(glyph)
for el in non_contours:
glyph.remove(el)
glyph.extend(normalized + non_contours)


# https://github.com/googlefonts/fontc/issues/1173
Expand Down

0 comments on commit 623edcd

Please sign in to comment.