3 ms·
Ooooh signed distance fields, if you ever get a good Rust implementation going make sure to publish it and add a readme that at least says what the code is so t
by trishume 11y ago
Ooooh signed distance fields, if you ever get a good Rust implementation going make sure to publish it and add a readme that at least says what the code is so that it can be found.
It could be great for other rust libraries, apps and games. None of them have subpixel rendering at the moment AFAIK and that's super easy with distance fields and real important for appearance.
- TD-Linux 11y ago>None of them have subpixel rendering at the moment AFAIK Actually, most Rust projects end up using Freetype for glyph rendering, which does support subpixel rendering. Signed distance fields are great for animated text, but they also have a couple of disadvantages - they generally produce lower quality output than Freetype at small glyph sizes, and the signed distance field is more complex to generate at start, which slows down initial page rendering. Given that 99% of web pages are static, it's a harder sell. Maybe some sort of heuristic based switching would work.
- constexpr 11y agoI'm surprised to hear they produce lower quality output at small glyph sizes. Fragment shaders can do multiple texture samples and I've gotten very high quality results. You can even do ClearType-style subpixel rendering with a handful of samples. The case where signed distance fields don't work is for large glyph sizes. They often end up chopping off corners or not having the density to represent thin calligraphic strokes.