Skip to content

Conversation

@cmyr
Copy link
Member

@cmyr cmyr commented Apr 22, 2025

This is a way of encoding the source of offset data in the case where it has to be passed in, which has been a longstanding request.

With this change, the method for getting a Script from a ScriptRecord looks like,

fn script<'a>(&self, data: impl OffsetSource<'a, ScriptList<'a>>)

instead of,

fn script<'a>(&self, data: FontData<'a>)

To avoid breakage (this should break no existing code), FontData can still be passed directly to any method that accepts an OffsetSource argument. This is not publicly documented, though, and it is expected that new code would pass in the tables themselves.

This is a way of encoding the source of offset data in the case where it
has to be passed in.

With this change, the method for getting a `Script` from a
`ScriptRecord` looks like,

```rust
fn script<'a>(&self, data: impl OffsetSource<'a, ScriptList<'a>>)
```

instead of,

```rust
fn script<'a>(&self, data: FontData<'a>)
```

To avoid breakage, `FontData` can still be passed directly to any method
that accepts an `OffsetSource` argument. This is not publically
documented, though, and it is expected that new code would pass in the
tables themselves.
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

1 participant