[write-fonts] Add 'PendingVariationIndex' table #544
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.
Per discussion at cmyr/fea-rs#185 (comment), this is adds a new type and a new enum variant that can be used to store the temporary ids assigned to
VariationIndex
tables during compilation. I quite like this; it simplifies the code in the VarStore builder, and it guarantees we never accidentally write one of these temporary values.This is intended as a sentinal, which can be assigned a unique ID during compilation, and then remapped to the final VariationIndex values once the ItemVariationStore has been compiled.
This type will panic if we attempt to serialize it, which will ensure that we never accidentally write temporary values to our VariationIndex tables.
Although this is not part of the spec I am generating this in codegen since it's much easier than trying to do it manually; making this work required adding a new attribute,
#[write_fonts_only]
, to communicate to codegen that we should not generate any parsing code for this type (since it is not a real type that should ever exist in an actual font file).