-
Notifications
You must be signed in to change notification settings - Fork 501
SVG-related improvements and fixes #569
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to see someone else's opinion on this, the changes I've suggested are relatively minor, this is however a breaking change PR, so we should probably lump it into 2.0.0
I was hesitant whether to mark it as breaking or not. Having upside down output is obviously not what anyone would expect, on the other hand it's been like that for years, so there's probably code out there that relies on it and flips it itself. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice addition, but we shall clarify ASAP if the next release is going to be 2.0.0, in which case some function argument could be completely migrated (number => object).
up-to-date with the current master and ready for re-review |
This is a breaking change as it changes some public facing apis, not just wither the SVG is upside down. |
You can still pass a number instead of the options object and it will be handled accordingly, or am I missing something else? |
Can we please talk about the roadmap and how to proceed with this? I'm not that keen on resolving endless conflicts should this get merged after other PRs with big changes. 🙂 Also this SVG fix is very helpful when testing new features/enhancements/fixes with the Unicode test suite. It was my understanding that we were going to release 2.0.0 next anyway (though I have to admit I'm not sure what that feeling is based on, as we never explicitly talked about it before) but if that's not the plan, we could at least have a dedicated 2.0.0 branch? Then I'll also scrap the partial backwards compatibility. |
@ILOVEPIE can we process? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is one comment I had regarding performance/readability, but it looks good.
This reverts commit b409260.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
This PR supersedes draft #568
Description
Motivation and Context
The library failed several tests in the unicode test tool, despite technically supporting the underlying features.
Exporting SVG paths was possible, but the paths were flipped upside down due to inverted Y-axes in SVG vs font paths. Importing SVG paths was not supported.
How Has This Been Tested?
We now pass 69 tests instead of 37 in the unicode test tool, see report: https://connum.github.io/opentypejs-reports/reports/test-connum_svg-optimize-7e4de2c2ce9e822161b61349cf2a7ec55c7fd05e.html
We didn't have any tests for path.js so I added several to test the basic and new features.
I played around with loading, exporting and modifying SVG paths in existing fonts.
Screenshots (if appropriate):
Types of changes
Will break code that relies on SVG data being upside down, but that behaviour was wrong in the first place
Checklist:
npm run test
and all tests passed green (including code styling checks).