chiark / gitweb /
Sort elements of the FeatureIndices array by feature tag
authorBen Harris <bjh21@bjh21.me.uk>
Wed, 29 Jan 2025 22:10:40 +0000 (22:10 +0000)
committerBen Harris <bjh21@bjh21.me.uk>
Wed, 29 Jan 2025 22:10:40 +0000 (22:10 +0000)
commit2cee520a532013788711892f409056761e10187e
tree9a9a08ddd367f03aa9f78ab38c1a4c5f404a6347
parent37dafb753abc99fb6a3530ffb0a1bc5592eb9ce7
Sort elements of the FeatureIndices array by feature tag

The OpenType spec (version 1.9.1) says, "The FeatureRecord array
should be sorted alphabetically by feature tag."  Bedstead was instead
emitting them in the order in which they appeared in the gsub_features
array, which was determined by the order the lookups need to occur in.
In particular, the 'cvXX' lookups need to occur after the 'ssXX'
lookups so as to override them properly.

Fixing this required some care to keep all the indices straight, but I
think I've managed it.
bedstead.c