Skip to content

[codegen] Typed data source for offsets in records #1475

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cmyr
Copy link
Member

@cmyr cmyr commented Apr 23, 2025

Take two. This adds a new getter for offset fields in records, where instead of passing in the FontData you pass in the appropriate table itself.

Take two. This adds a new getter for offset fields in records, where
instead of passing in the `FontData` you pass in the appropriate table
itself.
@cmyr cmyr force-pushed the typed-record-offset-data2 branch from 7e6ee81 to b730cb2 Compare April 23, 2025 17:41
@@ -431,9 +431,23 @@ impl BaseScriptRecord {
///
/// The `data` argument should be retrieved from the parent table
/// By calling its `offset_data` method.
///
/// NOTE: you should prefer to use [`read_base_script`][Self::read_base_script],
/// which takes the relevant parent table as input, instead of raw `FontData`.
pub fn base_script<'a>(&self, data: FontData<'a>) -> Result<BaseScript<'a>, ReadError> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think these ones should be #[deprecated]

Copy link
Member Author

Choose a reason for hiding this comment

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

last time I deprecated right away, dominik complained that it broke his build. I agree that this is a bit annoying though because without deprecating it's hard to point people to the new methods? cc @drott

Copy link
Collaborator

@rsheeter rsheeter left a comment

Choose a reason for hiding this comment

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

This is great! Ship it!

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.

[read-fonts] Stop asking me for FontData! Which one do you even mean?! It's not obvious which FontData to give
2 participants