Skip to content

[read-fonts] initial codegen for parsing sbix table#609

Merged
dfrg merged 2 commits intomainfrom
sbix
Sep 15, 2023
Merged

[read-fonts] initial codegen for parsing sbix table#609
dfrg merged 2 commits intomainfrom
sbix

Conversation

@dfrg
Copy link
Copy Markdown
Member

@dfrg dfrg commented Sep 12, 2023

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

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
Copy link
Copy Markdown
Member

@cmyr cmyr left a 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 🤷)

Comment thread 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,
Copy link
Copy Markdown
Member

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?

Copy link
Copy Markdown
Member Author

@dfrg dfrg Sep 14, 2023

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?

Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, will do!

Copy link
Copy Markdown
Member Author

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.

@dfrg dfrg merged commit 8207c89 into main Sep 15, 2023
@dfrg dfrg deleted the sbix branch September 15, 2023 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants