[codegen] Add wrappers on enums for shared methods #760
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.
This is for tables that have multiple formats, where all the formats have an identically named method; we will now generate a wrapper method on the enum itself that forwards to the inner methods.
In this patch this is only implemented for raw fields, and we do not generate the typed offset getters. This is quite a bit more complicated, and we can look into that as followup.
This ended up producing less code than I had expected, and most of that code is just exposing the
format
field. The two main 'real' cases are the bbox on glyphs and the coords on anchor tables, both of which we had previously hand-written implementations for.The main thing that we are missing here (pending support for offset getters) is resolving coverage tables on multi-format layout subtables.
progress on #687