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.
The font version number stored in the CFF table can not be set individually, nor is it preserved on a read/write cycle.
Description
[why]
The version number written out to a buffer is not the number stored in font.tables.cff.topDict.version. Instead some other human readable string is used even if the cff.topDict.version has been set correctly.
The CFF version number needs to be a string representing a number and nothing else; especially it should not contain 'Version'.
Documentation [1] says this:
The documentation is also valid for CFF1 in this regard.
[how]
Use the version string in the CFF table, if there is one. If not fall back to the (imho wrong) previous defaulting behavior.
[1] https://learn.microsoft.com/en-us/typography/opentype/otspec180/cff2#sectionD3
Description
Keep the version string that exists in the CFF table and do not invent one needlessly.
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
This shows reading a font file, printing the CFF font version number; then going through serialization and printing the broken CFF font version afterwards.
Types of changes
Checklist:
npm run test
and all tests passed green (including code styling checks).I would add tests to the Panose test case from #759 (to avoid merge conflicts now here).