https://github.com/rxi/microui
Just around 1100 lines of C code.
You need to bring your own renderer, but that's the same for Nuklear or Dear ImGui.
I wrote a WASM wrapper for the microui demo too:
https://github.com/rxi/microui
Just around 1100 lines of C code.
You need to bring your own renderer, but that's the same for Nuklear or Dear ImGui.
I wrote a WASM wrapper for the microui demo too:
I've configured the canvas upscaling to use point filtering because that looks nicer for Dear ImGui's and Nuklear's default pixel fonts (otherwise the text look slightly blurry after the upscaling), but the point filtering doesn't look exactly great for microui's default font.
Using a proper TTF font rendered in native resolution on a HighDPI display will look a lot better. But proper 'non-native' text rendering is a surprisingly tricky thing to do right.
Possibly a licensing issue as to why they don't include better ones by default as you have to bake it in? or they want to make the binary as tiny as possible by not using a bigger font file?
The hard part is text layout which is a very very complicated affair, especially if you want to support different languages and/or writing systems.
A nice font renderer is orders of magnitude more code, e.g., harfbuzz 25,000 lines of code with or FreeType with 245,000 lines of code. Many projects do not want that kind of bloat.
I'd guess some of these little ones allows using your own bmp font, so render a font you like, and use the rendered glyphs.
It isn't bloat if it's desired functionality. Not every project is optimized to run in an embedded environment, nor does it need to be.
And if you in particular want it, fork them and merge them.
https://floooh.github.io/sokol-html5/
Interestingly the imgui and nuclear both work on mobile while the microui demo doesn't appear to handle any input. Imgui works surprisingly well (although everything is a bit small for touch).