-
Notifications
You must be signed in to change notification settings - Fork 80
Transform CFF glyphs by their matrix #198
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
|
Can you run benchmarks? How much does it affect performance? It would be nice if we could skip this step for a default transform. |
|
before: after: so, seems to be a slight measurable impact on a couple of outline_glyph benchmarks. I'll throw in an |
|
Option gets back about half the performance pushed this along with test fixes |
|
I'm not happy with how units_per_em is getting passed around, particularly how I needed to type
|
|
This is definitely unfortunate, for one thing because it's annoying to have to pass this manually, but also because this would be a breaking change. I'm honestly not sure what the best way forward is here. :/ |
|
Well, while messy, it's always possible to add new methods for outline and glyph_width and deprecate the old broken ones, without strictly being a breaking change. But also I'm curious has this library made breaking changes before? is there established process? |
Sure, we are at version 0.25, so there have been many breaking changes before. However, the problem is that at this point, this library is more or less in maintenance-only mode as most of the momentum is shifting towards skrifa, and there are some adjacent crates that depend on ttf-parser like fontdb which, if I understood correctly, won't be updated anymore, so we definitely need to be more mindful about making breaking releases. I guess I just want to hear some other voices before making a decision on that. Sorry that the small bug you wanted to fix ends up being so hard to actually get merged. :( |
|
If adjacent crates won't be updated anymore and will stay on the current version forever then there's no problem with adding new breaking versions because they will never have to update to those 🤔 |
Well, it's desirable to avoid that because then you end up depending on two or more versions of |
|
As mentioned, I'm not strictly opposed to merging this, I just think it warrants some more opinons from the other maintainers before doing so. |
|
The patch looks good to me. As for breaking changes... we could wing it. Direct CFF parsing is technically a semi-private API and 99% of projects do not use it. And since bumping ttf-parser is kinda impossible at this points - that's the only thing we can do. PS: you should fix older Rust support. You use newer Rust features. Specifically if-let. |
|
Will fix for older rust. Aside, I'd still like thoughts on which API is better - add units_per_em argument to cff table constructor, or to outline + glyph_width? |
Some fonts use the shear part of this matrix to do an oblique version. See discussion at typst/pixglyph#3
|
To the CFF table constructor. This is how other tables are implemented as well. |
|
I wasn't sure because the upem is not part of the table, just information useful for interpreting the table, but if that's how the other constructors are then makes sense |
|
Thanks, I will land this soon but I’m not yet convinced about just landing this in a patch release, so we will see how we end up doing it. |
|
Thanks! |
Some fonts use the shear part of this matrix to do an oblique version.
See discussion at typst/pixglyph#3