Skip to content

Conversation

@UncraftedName
Copy link
Contributor

@UncraftedName UncraftedName commented Nov 19, 2025

Something I've noticed when looking through ImGui examples is the use of icon fonts.

81696852-c15d9e80-9464-11ea-9cab-2a4d4fc84396

To me this seems like a simple way to add a nice touch to the UI, and I've wanted to add reset/copy buttons to cvars shown in the UI ever since I started.

The ImGui docs suggest choosing an icon from this list. I looking through all of them and chose codicon because:

  • the icons are (mostly) fitting for my use case out of all the fonts there
  • it's one of the smallest (maybe the smallest) out of the listed fonts (89KB .ttf, and probably a fair bit smaller than that in the output binary since it's stored compressed)

The main window
image

Player trace tab
image

Errors/Warnings
image

SPT info menubar
image

Text HUD tab before PR
image

Text HUD tab after PR
image

The two main places I've added the icons are:

  • The tab headers at the top of the main window
  • Calls to SptImGui::CvarValue - basically any time a cvar is shown in the UI it will by default have a reset & copy button next to it unless it is a checkbox (this is most clear in the Text HUD Tab). The reset button sets the cvar back to its default value, and the copy button will copy e.g. spt_overlay 0 to your clipboard.

There is a slight adjustment I had to apply to the font to get it to visually line up with the current text font. I decided to make each icon monospace and exactly two english characters wide.

image image

This sample along with all of the other icons and their code points is shown in the Dev tab, and that can be used to find an appealing looking icon.
image

@UncraftedName UncraftedName force-pushed the imgui-icons branch 3 times, most recently from 67def9f to 24ddcb8 Compare December 5, 2025 19:19
@UncraftedName UncraftedName marked this pull request as ready for review December 8, 2025 04:28
@UncraftedName UncraftedName linked an issue Dec 8, 2025 that may be closed by this pull request
@lipsanen lipsanen merged commit 42595fd into OutOfBoundsOffice:master Dec 15, 2025
8 checks passed
@lipsanen
Copy link
Collaborator

tyty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ImGui - add icon font and incorporate icons into main window

2 participants