-
Notifications
You must be signed in to change notification settings - Fork 16
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
could you describe your general approach? #1
Comments
For shapes, I’m using Lyon to tress the paths into triangles. For text, I use font kit to draw to pixel map, and quad it. I checked out your repo the other day and SDF certainly looks really interesting. How does the font rendering looks comparing to “native”? |
Ah cool. Well for the font rendering I'm using fontdue, not the SDF path rendering. I'm using the same atlas texture technique as in nanovg (glyphs are rendered into the atlas as needed, as opposed to making a single atlas for an entire font). Perhaps this is the same as your approach. I think it looks quite good except there are potentially some layout issues with fontdue, and it lacks subpixel AA. I tried using my path renderer for glyphs and it's just too inefficient. |
How do you render stroked glyphs with fontdue? |
See here: https://github.com/audulus/vger-rs/blob/abe8274f8cc155a9018f339354ed5ee836c05861/src/glyphs.rs#L35 |
I tried that before. Just too many triangles that need to send to GPU. I'm recently trying swash to do the text rendering which supports subpixel AA and text shaping. The end result seems very good. |
The rasterize function outputs filled text, not stroked text. When I say stroked text, I mean something like this: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/strokeText |
I'm curious :)
I've got a 2D wgpu renderer that might be useful to look at and borrow from: https://github.com/audulus/vger-rs
cheers
The text was updated successfully, but these errors were encountered: