-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[read-fonts] initial codegen for parsing sbix table #609
Conversation
Starting work on bitmap support and figured I'd tackle the low hanging fruit first. This includes basic codegen for parsing sbix along with a tiny helper method to load `GlyphData` for a given glyph id. Working towards #593
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, I think matching the glyf/loca API is the right idea (not that there is another clear alternative, so 🤷)
resources/codegen_inputs/sbix.rs
Outdated
/// Bit 0: Set to 1. | ||
/// Bit 1: Draw outlines. | ||
/// Bits 2 to 15: reserved (set to 0). | ||
flags: u16, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we might want to define a flags type for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call. The unnamed bit 0 that must always be set to 1 seems problematic for the codegen flags type. Wdyt about wrapping in a record and implementing default and appropriate methods for the “render outlines bit” instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think an easier option would be to use flags, but use the compile_with
annotation to provide a fn that ensures that bit one is always set when writing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, will do!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since I'm adding compile_with
, went ahead and extended this for write support. Should be good to go.
Starting work on bitmap support and figured I'd tackle the low hanging fruit first. This includes basic codegen for parsing sbix along with a tiny helper method to load
GlyphData
for a given glyph id.Working towards #593