-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Zoomed layers result in blurry text #4813
Comments
Thinking about this some more, a quick fix might be to have a way to set the resolution of the glyph texture so that zooming up to a certain level remains crisp? |
I went down a rabbit hole today looking into this. I was curious how browsers deal with glyph sizes when it comes to pinch zooming and found a few interesting comments by @pcwalton:
https://news.ycombinator.com/item?id=32113767 I imagine the fastest thing you could do is use an algorithm similar to slug to generate these glyph atlases on the gpu while you're zooming. The downside of this is that a gpu algo is not going to cover all of the features that something like swash will be providing? Perhaps the best approach is some kind of glyph caching system that supports various sizes. With the plan to switch to cosmic-text: I noticed there is a SwashCache: so maybe we can use that to cache glyphs at various sizes when we need them for a particular zoom level? there is still the issue of what the texture atlas would look like in this setup, perhaps you would need something like for building these dynamically? I'm just thinking out loud here since I have yet to dive into the internals of egui's glyph atlas and caching. would be curious to hear @emilk 's thoughts on how we might do this. .... After doing some more digging it looks like glyphon does exactly this: and I noticed there is egui-glyphon also: ... I've updated egui-glyphon for 0.30.0 to see if I can get a proof of concept working: |
Describe the bug
When zooming using the
Pan Zoom
demo on the website, it appears the font doesn't get properly updated to the zoom level, and still renders at the quality of the initial depth.To Reproduce
Steps to reproduce the behavior:
Pan Zoom
demoExpected behavior
The text would not be blurry
Screenshots
Desktop (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: