Earlier quoted context omitted.
The default fonts are just plain awful. It's trivial to drop in a better font and make it indistinguishable from native. 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?
Font is one thing. 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.
Nuklear – A single-header ANSI C immediate mode cross-platform GUI library
71–80 of 103 posts
Re: Nuklear – A single-header ANSI C immediate mode cross-platform GUI library
#72Earlier quoted context omitted.
The price for the 'lightest' general UI toolkit probably goes to microui: 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://floooh.github.io/sokol-html5/sgl-microui-sapp.html
I love these kinds of UI frameworks except for one thing -- the text is always so poorly rendered. Not sure if it's just poor fonts or lack of good antialiasing, but compared to how a browser or native windowing system renders text, immediate mode GUIs are practically unbearable and make me want to close them after short usage. Maybe because I use a high-DPI screen (Macbook Air), not sure, but it feels like taking a…
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.
Re: Nuklear – A single-header ANSI C immediate mode cross-platform GUI library
#73Here's a simple WASM version of the Nuklear standard demo: https://floooh.github.io/sokol-html5/nuklear-sapp.html The big difference to Dear ImGui is that Nuklear has a C API and is also implemented in C - and apparently it has more skinning/themeing options, which I haven't tinkered with yet. TBH, for tools I prefer cimgui (a C wrapper around Dear ImGui), my impression is that Nuklear has a 'purer' immediate-mode de…
DearIMGUI has both an unofficial C wrapper and a new official C binding generator. I have personally used the CIMGUI wrapper with C99 apps using the Direct3D11 backend and it works great. The new API is started by the DearIMGUI creator but is still adding features that are available in CIMGUI. Unofficial C API - https://github.com/cimgui/cimgui Official binding gen - https://github.com/dearimgui/dear_bindings
Re: Nuklear – A single-header ANSI C immediate mode cross-platform GUI library
#74Earlier quoted context omitted.
I love these kinds of UI frameworks except for one thing -- the text is always so poorly rendered. Not sure if it's just poor fonts or lack of good antialiasing, but compared to how a browser or native windowing system renders text, immediate mode GUIs are practically unbearable and make me want to close them after short usage. Maybe because I use a high-DPI screen (Macbook Air), not sure, but it feels like taking a…
This one is 1100 lines of code, nice for embedded project. 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.
Re: Nuklear – A single-header ANSI C immediate mode cross-platform GUI library
#75I've been using nanogui[0] to fit the bill for personal uses. To be honest though, I'm at the point where I'd really prefer an easy and lightweight library to setup a http and/or websocket server, and just make a ui in the browser. I've got a simple use case -- I'm just making a simple scene editor & debugging ui for a toy ray tracer. I know there are a ton of different libraries out there for the task, but that just…
Wouldn't that mean that the expiry date of your GUI is like: a few years or so?
Since web-stuff seems to change so constantly with breaking changes and revamps every few years being the norm.
Whereas a WIN32 app (or Unix or other) from 25 years ago probably still runs fine? I can't imagine the same for any web-app that was written for Netscape and now has to run in a modern browser.
Re: Nuklear – A single-header ANSI C immediate mode cross-platform GUI library
#76I use Nuklear for a Steam game I made in C. It worked well for my needs but there are a few things I still haven't figured out yet - like rendering centered multi-line text. Localizing my game was very straightforward with Nuklear - I didn't run into any roadblocks with fonts or different alphabets. I was able to get the interfaces to be controller-friendly too. Overall, I had a positive experience and will use it ag…
Re: Nuklear – A single-header ANSI C immediate mode cross-platform GUI library
#77> * Written in C89 (ANSI C) Just why. C17 exist. Why is is that some developers stick with C89, whilst in the C++ community, unless you work for some really backwards company, you adopt the latest standard before it's even officially nailed down? C89 needs to die. Stop supporting it.
Re: Nuklear – A single-header ANSI C immediate mode cross-platform GUI library
#78* Raylib - A single header file game engine https://www.raylib.com/ * Miniaudio - A single header file audio library https://miniaud.io/
Both (actually, not just three systems) cross-platform.
For their design and cross-platform support they make for great bases for Go libraries, unlike most C code out there.
Re: Nuklear – A single-header ANSI C immediate mode cross-platform GUI library
#79I use Nuklear for a Steam game I made in C. It worked well for my needs but there are a few things I still haven't figured out yet - like rendering centered multi-line text. Localizing my game was very straightforward with Nuklear - I didn't run into any roadblocks with fonts or different alphabets. I was able to get the interfaces to be controller-friendly too. Overall, I had a positive experience and will use it ag…
Did the Steam Overlay work?
Re: Nuklear – A single-header ANSI C immediate mode cross-platform GUI library
#80I've been using nanogui[0] to fit the bill for personal uses. To be honest though, I'm at the point where I'd really prefer an easy and lightweight library to setup a http and/or websocket server, and just make a ui in the browser. I've got a simple use case -- I'm just making a simple scene editor & debugging ui for a toy ray tracer. I know there are a ton of different libraries out there for the task, but that just…
> To be honest though, I'm at the point where I'd really prefer an easy and lightweight library to setup a http and/or websocket server, and just make a ui in the browser. Wouldn't that mean that the expiry date of your GUI is like: a few years or so? Since web-stuff seems to change so constantly with breaking changes and revamps every few years being the norm. Whereas a WIN32 app (or Unix or other) from 25 years ago…
you see a lot of churn in the web ui world because browsers implement new features that new libraries take advantage of. it seems to be stabilizing a bit around react. the developers in the space do tend to reinvent the wheel more.
it's not that big of a deal to me though, because it's a pet project, not a professional product. if i want to show it off to non-technical friends/family, it's a lot easier for me to point them to a webpage than it is to have them install some binary I produce.
having a native gui isn't precluded going this route either, I'd just have a native gui connect via socket rather than interact directly.
> Whereas a WIN32 app (or Unix or other) from 25 years ago probably still runs fine? I can't imagine the same for any web-app that was written for Netscape and now has to run in a modern browser.
Sure, but then I'd have to learn all of the platform specific apis, or go with something like nuklear or nanogui (like i'm doing now). which is fine, sort of. it's not really the development I want to be doing, and it's got a frustrating workflow.
Just due to my background, having started my career in webdev, i feel more comfortable doing ui work in a browser than i do fussing with native or opengl based uis.