logoalt Hacker News

radio879 • today at 3:21 PM • 2 replies • view on HN

You know what I found this past year was that I could NOT find any way, to turn off anti-aliasing, for text inside a webview. I made a whole entire custom terminal app just for myself in Rust, Tauri, xterm.js and spent a ton of time trying to un-blur the text but failed. I redid the entire thing (well, Codex/Claude mostly) using a rust graphics library (egui) and now the text is finally sharp! and its fast. I am growing more and more anti webview with these AI coding tools.. they can almost one-shot convert a slow webview app into something that uses 1/10th the ram and 10x as fast. The text looks soooo much better, all fonts look better. In xterm.js, text looks super fat all the time (to me).


Replies

kccqzy • today at 4:51 PM

You are asking for a look that’s very niche. Not many people hate anti-aliasing so much. GNOME still has a simple UI to turn off anti-aliasing but not many apps respect that. The modern text rendering pipeline is just way too complicated from font lookup, ligatures, shaping, etc. To achieve this look in web views you’ll most certainly need to do it in <canvas>. And of course, you can still choose to draw all the text using software rendering using JavaScript or use WebGL2 and ship it to the GPU: conveniently the constructor allows you to turn off antialiasing `canvas.getContext("webgl2", {antialias: false})`.

catlifeonmars • today at 3:38 PM

You could also render the text inside a canvas in a web view, then you have a bit more control over the sampling. If you wanted to stick to a web view for some reason that is. Alternatively you could generate custom bitmap fonts on the fly based on the screen resolution.