Skip to content

Add Swash test harness #99

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 7 commits into
base: main
Choose a base branch
from

Conversation

valadaptive
Copy link
Contributor

@valadaptive valadaptive commented Mar 16, 2025

I'm not involved with Swash, but I was curious how it fares. I created this test harness and thought others may find it useful, both for testing Swash and as a starting point for writing test harnesses for other Rust-based text rendering stacks.

I ran into some curious test failures:

  • Some tests failed because Swash can't get glyph names from the cff table, only the post table, and the glyph names have to match in order for the tests to pass. I've temporarily switched to using ttf-parser only for reading glyph names in order to avoid these test failures. There's a PR in the works to allow skrifa, a font parsing library (somewhat) used by Swash, to read glyph names from both tables. Once that lands, Swash can probably switch to that.
  • Some tests are failing despite visually identical results, because there's an extra "line to" command to return to the start of an outline before a "close path" command that does the same thing. I'm not sure what needs to be done to fix this.
  • Some tests are failing because combining marks are being rendered in the wrong order for RTL text. This is visually identical--it's the rendering order that changes, not the visual order.

/cc @dfrg: Not sure how much Swash is being worked on right now or if the plan is to eventually move everything over to skrifa or other crates, but hopefully there's some value in having this test harness available.

@CLAassistant
Copy link

CLAassistant commented Mar 16, 2025

CLA assistant check
All committers have signed the CLA.

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