Preserve format of value records after reading #861
Merged
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.
ValueRecords have an explicit format, which is generally stored once in their parent table. In the case of records with device or variation tables, we need to know the format in order to write them correctly, since it's possible for these fields to be legitimately null, and we cannot distinguish between a record which where a field is None because it is not included versus when it is intended to be null.
Previously, we would use the format when reading the table but would then discard it. This led to a bug where we would not know the correct format when we went to write the table back.
With this patch, we hold onto the format after reading, and pass it to write-fonts if we convert to write-fonts types. This ensures that we roundtrip tables correctly in this case.
closes #858