-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Replace ab_glyph with Skrifa + vello_cpu; enable font hinting #7694
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
|
Preview available at https://egui-pr-preview.github.io/pr/7694-skrifa View snapshot changes at kitdiff |
|
I'm very excited for this! The readability improvements of the font hinting is pretty big imho. Also: colored emojis unlocked??? Before we merge I want to make sure we measure what impact this has on the .wasm blob size ( |
|
Regarding the quality of the rendering, I have found that adding "font embolden" (aka stem darkening) to the skrifa-based renderers is (subjectively) a big additional improvement, at least on macOS (by tweaking the embolden parameter I can make the rendering very close if not identical to Skia/Chrome). There's no implementation for |
|
Hey I just wanted to throw a vote behind this. Is there something blocking we at @tritium-legal can help with? Hinting on normal DPI platforms just makes a massive difference. |
|
wasm size on so +600kB. I think that's well acceptable. |
| checksum = "68c7541fff44b35860c1a7a47a7cadf3e4a304c457b58f9870d9706ece028afc" | ||
| dependencies = [ | ||
| "kurbo", | ||
| "kurbo 0.11.1", |
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.
It's a shame we get a duplicate kurbo because of resvg, and resvg hasn't had a crate release in over 8 months :/
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.
We can fix that. I am working on a round of releases this month.
|
All snapshots look good |
|
I encourage everyone to follow this link to experience the improvements: https://rerun-io.github.io/kitdiff/?url=https://github.com/emilk/egui/pull/7694 |
- Followup to #7694 - Disables the `traversal` feature of `skrifa` which is not needed except internally by the fontations project - Should save a little compile time, and possibly some binary size. Signed-off-by: Nico Burns <[email protected]>
I'll probably come back to this and clean it up a bit. This PR reimplements ab_glyph's functionality on top of Skrifa, a somewhat lower-level font API that's being used in Chrome now.
Skrifa doesn't perform rasterization itself, so I'm using vello_cpu from the Linebender project for rasterization. It's still in its early days, but I believe it's already quite fast. It also supports color and gradient fills, so color emoji support will be easier.
Skrifa also supports font hinting, which should make text look a bit nicer / less blurry.
Here's the current ab_glyph rendering:
Here's Skrifa without hinting--it looks almost identical, but there are some subpixel differences, probably due to rasterizer behavior:
Here's Skrifa with hinting:
Hinting does make the horizontal strokes look a bit bolder, which makes me wonder once again about increasing the font weight from "light" to "regular".