-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
## ImGui + FontAwesome Example | ||
|
||
- Icon header provided by [IconFontCppHeaders](https://github.com/juliettef/IconFontCppHeaders) | ||
- Font binary generated using ImGui [binary_to_compressed_c](https://github.com/ocornut/imgui/blob/master/misc/fonts/binary_to_compressed_c.cpp "binary_to_compressed_c.cpp") | ||
- Built using ImGui DirectX11 Example | ||
|
||
### How to Update Font Files | ||
1. Download from webfonts [FontAwesome .tff file](https://github.com/FortAwesome/Font-Awesome/"webfonts") | ||
2. Download (or generate) updated headers from [IconFontCppHeaders](https://github.com/juliettef/IconFontCppHeaders) | ||
3. Convert .tff file to byte array | ||
4. Replace template example files | ||
|
||
### How to convert .tff to header file | ||
1. Download [binary_to_compressed_c](https://github.com/ocornut/imgui/blob/master/misc/fonts/binary_to_compressed_c.cpp "binary_to_compressed_c.cpp") and compile following file comments (or use precompiled version from release) | ||
2. Run generated executable *with fonts in same folder that executable* using following parameters: ```binary_to_compressed_c.exe fa-solid-900.ttf FontAwesome > fa.h``` | ||
3. Finished | ||
|
||
#### Performance Implications: | ||
I had some issues with performance degradation when using custom icons in a extreme low-end hardware (in a application with a HUGE iterations per second) | ||
|
||
#### See more detaills about implementation in main.cpp |