It seems like an icon font would be pretty useful for imgui. I threw something together for imgui to use, with the hope that it could become something fairly standard.
Hello @traverseda,
Using/merging icon fonts are largely encouraged (and described in misc/fonts/README) however I don't think it would be suitable to embed a default within the imgui codebase.
I added two references to OpenFontIcons here: e610afeea31a8e8f659b2762591444e19fad55c1
For accessibility, you may want to provide header files for them, using the same script as https://github.com/juliettef/IconFontCppHeaders
Let me know if you have a suggestion.
Thanks for the support, I'll see about adding headers soon.
Why don't you think it's suitable to embed a default? I'd like to see a default/standard used by terminal apps, so insight into either why you don't want a default, or why OpenFontIcons is not a good default, would be appreciated.
It's useful information for when I try to approach other projects about standardizing on OpenFontIcons.
If it's simple a matter of making the textures too big, well I do agree with that.
Because unlike textual fonts, swapping icon fonts needs user code to be changed (the unicode points are not standard) and there are many other fonts people may already use, most commonly FontAwesome.
Making it a default would make it hard to change it to another font, lead people into relying on something I am not maintaining and unable to maintain/update and which future is currently unknown (people will come and request new icons all the time, if those requests can鈥檛 be fullfilled they have to consider using another icon fonts which is tricky.. best to make that font choice ahead of time).
An idea to increase adoption would be to make/release remapping tables to use eg icon font xx with the codes of fontawesome 4/5. Imgui could trivially support code for remapping.
I think the whole thing would be a lot easier if there was some kind of standard. Why not include FontAwesome by default?
I'm happy to write some utility code, but I'm mostly just interested in there being some kind of standard. It doesn't matter to me if I'm in charge of it or not, or if that standard is FontAwesome. I think there are things that make FontAwesome unsuitable as a standard, but it's obviously very popular.
Would you be more comfortable with it if you were an owner of the project?
I'm having a hard time finding a full list of all of FontAwesome's code points, but to the best of my knowledge OpenIconFonts doesn't actually overlap with any of their icons yet. It's possible that there would be a collision in the future though.
My next step would be making whatever standard easy to install for terminal users, probably via a PIP package.
I think the whole thing would be a lot easier if there was some kind of standard. Why not include FontAwesome by default?
Because it is not easy to change icon fonts after the fact, I think providing an icon font by default is potentially worse than not providing a default. Even merely the fact that if I start using icons in imgui_demo.cpp it means people can never change the icon easily without getting a garbled demo.
We can certainly facilitate and document the use of icons better to help people making a choice.
Would you be more comfortable with it if you were an owner of the project?
No because it's not my project either way, I don't have the skills, time and resource to maintain an icon font.
My next step would be making whatever standard easy to install for terminal users, probably via a PIP package.
I'm not sure what this has to do with imgui, nor what you mean by "standard" in this context. If you are trying to popularize an icon font _outside_ of the scope of imgui, that's yet another thing.
Because I forgot to explicitly state that, I shall mention there is room for a project like OpenFontIcons in particular if you think you can reactively create new icons suitable for game devs, and assist people in adding them own icons themselves.
FontAwesome is good but its popularity also makes it really hard to get new icons added on a per-need basis.
For the specifics of dear imgui, you should note that thin shapes are likely to not render as neatly as a ClearType-enabled or OS-quality sub-pixel font renderer, especially when using the default stb_truetype-based rasterizer.
I'm not sure what this has to do with imgui, nor what you mean by "standard" in this context. If you are trying to popularize an icon font outside of the scope of imgui, that's yet another thing.
I think providing an icon font by default is potentially worse than not providing a default
The reason it's worse is because there is no standard for icon fonts, and there won't be a standard for icon fonts until someone makes there be a standard for icon fonts. If there was a standard, multiple icon-fonts could coexist a lot easier.
it means people can never change the icon easily without getting a garbled demo.
I mean, it also means that nobody else can use icons without getting a garbled widget. Right now people don't seem to be releasing higher-level widgets for this toolkit, but if they did they also wouldn't be able to use icons.
Imgui could trivially support code for remapping.
Am I understanding this correctly, that you could assign glyphs new code points dynamically? Then I really don't understand the problem, you should be able to provide a default and map other icon fonts into their own namespace.
But like I say, I'm not too worried about it. It took me all of 20 minutes to throw together, and I appreciate the time you took to include it in the documentation.
You should consider the advantages that including a default icon font would provide though, especially with regards to collaboration between people building things on top of imgui.
Because I forgot to explicitly state that, I shall mention there is room for a project like OpenFontIcons in particular if you think you can reactively create new icons suitable for game devs, and assist people in adding them own icons themselves.
FontAwesome is good but its popularity also makes it really hard to get new icons added on a per-need basis.
Ahh, I think there's a misunderstanding. I didn't make that font. As the docs state, that's just the MIT-licensed feather-icons right now. They didn't provide it as a TTF font, just as SVG files, so I ran a conversion on them, while removing all the branded glyphs (having trademarked icons in your font seems like it could be an issue).
If someone wanted a new icon, they could just give it a number (as part of their file name) and modify one of the existing glyphs using anything that can deal with SVG files.
The reason it's worse is because there is no standard for icon fonts, and there won't be a standard for icon fonts until someone makes there be a standard for icon fonts. If there was a standard, multiple icon-fonts could coexist a lot easier.
That's true but imgui isn't in a position to dictate standards either. If anything, I would guess that FontAwesome is closer to being a standard than anything.
You should consider the advantages that including a default icon font would provide though, especially with regards to collaboration between people building things on top of imgui.
I do agree this would be useful.
As a workaround, widgets could provide a set of define or strings/char* to specify icons, but I agree it wouldn't be a very neat solution.
Imgui could trivially support code for remapping.
Am I understanding this correctly, that you could assign glyphs new code points dynamically? Then I really don't understand the problem, you should be able to provide a default and map other icon fonts into their own namespace.
Yes that's correct. If this is well designed/developed this is something which can be considered. It's not a no-friction thing either as every font contains different characters but it would be a good step ahead.
Interestingly, with support for such table in the font loader, we wouldn't even need to decide on the standard list (but FontAwesome could be the base), just provide the remapping tables.
Ahh, I think there's a misunderstanding. I didn't make that font. As the docs state, that's just the MIT-licensed feather-icons right now. They didn't provide it as a TTF font, just as SVG files, so I ran a conversion on them, while removing all the branded glyphs (having trademarked icons in your font seems like it could be an issue).
Thanks, didn't realize that as I skimmed on your README.