Skip to content
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

[IFT] major rework to the IFT API around patch intersection and application. #1239

Merged
merged 19 commits into from
Nov 15, 2024

Conversation

garretrieger
Copy link
Contributor

@garretrieger garretrieger commented Nov 13, 2024

Adds a new patch_group module which generates a candidate set of URIs to be applied next based on the list of intersecting patches. The candidate URI group is structured to enforce compatibility constraints between patches. PatchGroup's can then be used to trigger the next iteration of patch application.

Example usage:

loop {
  let g = PatchGroup::select_next_patches(font, &subset_definition).unwrap();
  if !g.has_uris() {
    break;
  }

  // g.uris() lists patches to be downloaded, 
  // patch_data is populated with downloaded data.
  let patch_data = ...;

  font = g.apply_next_patches(&mut patch_data).unwrap();
}

This api constructs a group of patches from an IFT font which should be loaded and applied next. The patch group object is structured so that the set of contained patches is always a compatible set.
Prepare the api to work within the PatchApplicationGroup framework.
Remove static typing on the mapping table type.
This is needed because after an invalidating patch is applied the resulting font needs to be rechecked for which patches are needed. So application applies only one scope of patches and consumes the group forcing the caller to reform a new group.
Copy link
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.

I have no familiarity with the IFT spec, but reading through this nothing strikes me as egregious. I've left some little rust style nits inline.

incremental-font-transfer/src/glyph_keyed.rs Outdated Show resolved Hide resolved
incremental-font-transfer/src/glyph_keyed.rs Show resolved Hide resolved
incremental-font-transfer/src/patch_group.rs Outdated Show resolved Hide resolved
incremental-font-transfer/src/patch_group.rs Show resolved Hide resolved
incremental-font-transfer/src/patch_group.rs Outdated Show resolved Hide resolved
incremental-font-transfer/src/patch_group.rs Show resolved Hide resolved
incremental-font-transfer/src/patchmap.rs Show resolved Hide resolved
incremental-font-transfer/src/table_keyed.rs Outdated Show resolved Hide resolved
incremental-font-transfer/src/table_keyed.rs Show resolved Hide resolved
incremental-font-transfer/src/table_keyed.rs Outdated Show resolved Hide resolved
@garretrieger garretrieger merged commit 5126491 into main Nov 15, 2024
10 checks passed
@garretrieger garretrieger deleted the patch_api branch November 15, 2024 23:48
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