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

Additional tests and fixes for BezPath::reverse_subpaths #309

Merged
merged 2 commits into from
Oct 4, 2023

Conversation

dfrg
Copy link
Contributor

@dfrg dfrg commented Oct 4, 2023

The initial PR for this was missing a large batch of test cases. Adding these revealed that subpath reversal did not accurately capture degenerate contours (move only or move + close) which we'd like to retain in glyphs.

This adds the tests and updates the code to pass them (ref: https://github.com/googlefonts/fontations/blob/145a2ae269f30a3fbc217ef9cddb18a8a80a8f5b/write-fonts/src/pens.rs#L562C1-L564C104)

The initial PR for this was missing a large batch of test cases. Adding these revealed that subpath reversal did not accurately capture degenerate contours (move only or move + close) which we'd like to retain in glyphs.

This adds the tests and updates the code to pass them (ref: https://github.com/googlefonts/fontations/blob/145a2ae269f30a3fbc217ef9cddb18a8a80a8f5b/write-fonts/src/pens.rs#L562C1-L564C104)
}

#[test]
fn test_reverse_single_point_closed() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

this test and the one immediately preceding are exactly the same as test_reverse_move_only_path_offset_validity and test_reverse_move_close_path_offset_validity, are they not?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They appear to be, but I just copied them all directly from our tests in write-fonts :) I'll remove the redundant ones.

@dfrg dfrg merged commit 9c63e00 into linebender:main Oct 4, 2023
14 checks passed
@dfrg dfrg deleted the reverse-tests branch October 4, 2023 18:27
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