-
-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
StyleSetter: apply SetFontSize for all default fonts (not only first one) #712
Comments
so, if index 0 is the only case, fix here should be easy to do. It just needs some extra stuff in style setter to extend |
Yeah and This Line 62 in 304f0b9
Also there is no need to add me method - setfont can be modified |
I can get to work on this |
if I push multiple fonts, doesn't it just use the font on top of the stack? How does it then render the button with the icon? |
I suppose that when you push multiple fonts it tries to use this on top of the stack, then it tries the next and so on... iirc there was something like |
Is there by chance any way to view the current fonts on the stack? |
no idea... You can search in cimgui_funcs.go in cimgui-go repo but I'm affraid that no... |
Well i wrote something, but it doesn't work. If you want to take a look, its here. |
Bruh I read the read the source code all the way to dear imgui source and have no idea |
Still have to figure out why does it work withou setting the font size... I will think about it. |
Bruh I dont think there is a way to acomplish this without a major rewrite of a lot of things, which would in turn break a ton of other stuff. If you want icons in your font, just use a nerd font. They have all the icons from awesome and a lot more. |
What happend?
If one is adding fonts containing e.g. icons or other special charactes with
FontAtlas.SetDefaultFont(...)
and usesStyleSetter.SetFontSize(...).To(...)
afterwards, only text/characters/glyphs contained in the last added default font are shown.This seems to be, because new default fonts are prepended to the list of default fonts here in SetDefaultFont(...) and the
StyleSetter.SetFontSize(...)
uses index 0 of the default fonts.The minimal example does currently not show any icon at all, because of #711 but looks as follows on v0.7.0:
I don't have any idea, how this could be fixed, because as far as i understand the magic happens by merging the default fonts in
rebuildFontAtlas
, which is not done for the extra fonts (which StyleSetter uses to do the styling)Code example
main.go
To Reproduce
Version
master
OS
Linux
The text was updated successfully, but these errors were encountered: