[outlineOTF] only write PostScript BlueValues when are not empty #115
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently ufo2ft writes all the four blue values (
BlueValues
,OtherBlues
,FamilyBlues
,FamilyOtherBlues
) whenever eitherpostscriptBlueValues
orpostscriptOtherBlues
are non-empty lists in the UFO fontinfo.plist. It only checks those two, but then writes all four of them.So even if the others are empty, they will still be compiled as empty deltas in the CFF PrivateDict.
Now, it turns out the OpenType Sanitizer will reject such CFF fonts with empty Blues operators in the PrivateDict:
See https://github.com/khaledhosny/ots/blob/dcfa05f/src/cff.cc#L378-L385
I am not sure whether it's OTS that is being too picky, or whether these empty deltas in PrivateDict are actually invalid in CFF.
In any case, we can work around this OTS failure by setting each of these PrivateDict blues only if they are not empty -- rather than checking if only two of them are non-empty.
The same ufo2ft behaviour of writing empty deltas was also triggering another fonttools issue (now fixed):
fonttools/fonttools#883