The OT spec has the following note:
An empty INDEX is represented by a count field with a 0 value and no additional fields. Thus, the total size of an empty INDEX is 4 bytes.
Is this implemented?
https://learn.microsoft.com/en-us/typography/opentype/spec/cff2#common-formats-dict-and-index
The same goes for CFF-1 Index as well. Looks like we read/write Index1 / Index2 fully (offSize, offsets array) even if count is 0:
https://github.com/googlefonts/fontations/blob/main/resources/codegen_inputs/postscript.rs
For writing, this just writes a couple of extra unnecessary bytes. But for read, this can err when the data is correct.
The OT spec has the following note:
An empty INDEX is represented by a count field with a 0 value and no additional fields. Thus, the total size of an empty INDEX is 4 bytes.
Is this implemented?
https://learn.microsoft.com/en-us/typography/opentype/spec/cff2#common-formats-dict-and-index
The same goes for CFF-1 Index as well. Looks like we read/write Index1 / Index2 fully (offSize, offsets array) even if count is 0:
https://github.com/googlefonts/fontations/blob/main/resources/codegen_inputs/postscript.rs
For writing, this just writes a couple of extra unnecessary bytes. But for read, this can err when the data is correct.