Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What would you say is state of the art for Rust-native text rendering on the web?

I'm aware of ab_glyph, used by e.g. https://www.egui.rs/ but it looks noticeably non-native to my eyes. For one there seems to be no hinting. So text ends up blurry at 96dpi, and since a glyph stroke is thinner than a pixel the text always appears slightly faded, never able to reach fully black or white.

I wish these libraries would just use native APIs on each platform to render text, then all these problems would already be solved by the OS/browser. Though I'm not sure if the web has good APIs for that.

Maybe there's something better in Rust these days that I missed?



My personal applications tend to use only monospaces fonts and stick to Latin characters so I can get away with glyph rendering and then a very simple layout algorithm so something like ab_glyph or freetype is enough and I don't need harfbuzz.

I'm aware of swash and the other libraries in that stack, but it was going through a rewrite. The Linux support was incomplete, for example, it was dependent on a piped call to fc-list and parsing the output to get the system fonts.

Also, if I were doing it via web, I'd be tempted to render to an offscreen canvas and call it a day.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: