Open behdad opened 1 month ago
These specifications don't really conflict, they just don't pull the whole definition into one place. I believe its:
if vsindex operator in charstring:
vsindex = (charstring vsindex operand)
else if vsindex operator in glyph's privatedict:
vsindex = (privatedict vsindex operand)
else
vsindex = 0
What you sketch is correct indeed. But I have in the past read "By default, the first ItemVariationData structure (index 0) will be used. The vsindex operator can be used for glyphs that require a different list of regions." and assumed the glyphs default to vsindex 0 if none is specified. I'm still auditing FontTools & HB code for that assumption I might have put into code.
So we just need to tune up the language -- I'm fine with that.
I'm surprised at what I think I'm seeing. Please correct me if I'm wrong.
Part of the CFF2 spec says:
But then there's text that says:
And in another place:
Humm. So, which is it. If a CharString doesn't have a
vsindex
operator, is the first ItemVariationData structure (index 0) used, or thevsindex
specified in the PrivateDICT is used? Looks like the intention is the latter. I find the first quotation above misleading and suggest changing it to say that it defaults to 0 in the PrivateDICT case only.I think I have unfortunately written some code, either in FontTools or HarfBuzz, that assumes that
vsindex
defaults to 0 in CharString processing.