News for hackers. Stuff that matters.
Re:Uno: Single-Codebase for Windows, WebAssembly, iOS, macOS... by flohofwoe on Thursday November 05, 2020 @10:48AM (#24999230)
I think there's still a lot of room for improvement ;) For instance when you look at these demos:

https://floooh.github.io/sokol-html5/

These are also "write once, run anywhere" but with more focus on keeping the binary size small (both in WASM and for the native versions).

These demos start at 23 KBytes compressed and go to 537 KBytes compressed for the biggest UI sample (over half of those 537 KB is embedded TTF font data though).

At the same time, if I'd be using Qt instead of Dear ImGui to create the UI, the resulting WASM size probably would be similar to the UNO samples,

Writing cross-platform code that also works well on WASM really needs a different mindset from the ground up IMHO.

Re:Uno: Single-Codebase for Windows, WebAssembly, iOS, macOS... by jcelerier on Thursday November 05, 2020 @03:07PM (#25001476)
for some reason the text looks quite a bit more blurry and less readable than the same thing rendered with Qt on my machine. You should really consider using Freetype, Harfbuzz and friends, right now it looks like there is no hinting or something like that - see e.g. https://i.imgur.com/YgKFcd0.png

(yours top, Qt version bottom - I tried to match the font sizes visually but did not manage to decipher your code to find out exactly what they should be x) )

Re:Uno: Single-Codebase for Windows, WebAssembly, iOS, macOS... by flohofwoe on Friday November 06, 2020 @03:54AM (#25006126)
Yeah, that's one downside of focusing on size alone, you'll have to make many compromises what to include and what to leave out. I'd love if browsers would have font- and text-rendering APIs that are low-level enough to integrate with WebGL/WebGPU.
Re:Uno: Single-Codebase for Windows, WebAssembly, iOS, macOS... by Jasper_ on Sunday November 08, 2020 @11:51AM (#25026964)
I have been planning to write one based around 2D canvas that uses pixel scanning and alignment properties to compute the metrics information that has been missing from the native APIs. Would allow a basic glyph atlas and layout, but I do wish had access to a glyph shaper directly....