Skip to content

Commit

Permalink
Create README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
caiocinel authored Dec 22, 2023
1 parent 4931024 commit 2c571bc
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.md
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

0 comments on commit 2c571bc

Please sign in to comment.