Minimal documentation about how to use icon fonts #42
kraptor
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Here it is some documentation about how to use icon fonts, as it took me a while to make it work: default values while initializing ImFontConfig struct are not expected, so we have to initialize the struct fully. You may add this to documentation or examples if you wish 😄
During initialization, load the font alongside the default one (or after any other font you already loaded):
Finally, pass strings using proper unicode characters to buttons, windows, etc. using an unicode literal:
You can check the reference to know what icon corresponds to what character here: https://raw.githubusercontent.com/FortAwesome/Font-Awesome/fa-4/src/icons.yml
See a reference of unicode characters and its corresponding icons for various icon fonts in the following repo: https://github.com/juliettef/IconFontCppHeaders
Cheers!
Beta Was this translation helpful? Give feedback.
All reactions