googlefonts / nanoemoji

A wee tool to build color fonts.
Apache License 2.0
239 stars 19 forks source link

reorder_glyphs: must sort PairSet.PairValueRecords by the glyph ID of the second glyph #425

Closed anthrotype closed 2 years ago

anthrotype commented 2 years ago

Fixes an issue found while running fonttools instancer on a COLR font whose glyphs had previously been reordered by maximum_color (in order to add an OT-SVG table to it).

We also need to sort PairPosFormat1.PairSet.PairValueRecord array by the glyph ID of the PairValueRecord.SecondGlyph.

See: https://github.com/google/fonts/pull/5129 https://docs.microsoft.com/en-us/typography/opentype/spec/gpos#pair-adjustment-positioning-format-1-adjustments-for-glyph-pairs