Skip to content

Commit c04ed71

Browse files
committed
use a vector mono font and scale it properly
1 parent 4ed6e65 commit c04ed71

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

UI/main.cpp

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ int main(int, char **) {
6666

6767
// Setup Dear ImGui style
6868
ImGui::StyleColorsDark();
69-
// ImGui::StyleColorsLight();
7069

7170
// Setup scaling
7271
ImGuiStyle &style = ImGui::GetStyle();
@@ -82,23 +81,9 @@ int main(int, char **) {
8281
ImGui_ImplWin32_Init(hwnd);
8382
ImGui_ImplDX11_Init(g_pd3dDevice, g_pd3dDeviceContext);
8483

85-
// Load Fonts
86-
// - If no fonts are loaded, dear imgui will use the default font. You can also load multiple fonts and use ImGui::PushFont()/PopFont() to select them.
87-
// - AddFontFromFileTTF() will return the ImFont* so you can store it if you need to select the font among multiple.
88-
// - If the file cannot be loaded, the function will return a nullptr. Please handle those errors in your application (e.g. use an assertion, or display an error and quit).
89-
// - Use '#define IMGUI_ENABLE_FREETYPE' in your imconfig file to use Freetype for higher quality font rendering.
90-
// - Read 'docs/FONTS.md' for more instructions and details. If you like the default font but want it to scale better, consider using the 'ProggyVector' from the same author!
91-
// - Remember that in C/C++ if you want to include a backslash \ in a string literal you need to write a double backslash \\ !
92-
// style.FontSizeBase = 20.0f;
93-
// io.Fonts->AddFontDefault();
94-
// io.Fonts->AddFontFromFileTTF("c:\\Windows\\Fonts\\segoeui.ttf");
95-
// io.Fonts->AddFontFromFileTTF("../../misc/fonts/DroidSans.ttf");
96-
// io.Fonts->AddFontFromFileTTF("../../misc/fonts/Roboto-Medium.ttf");
97-
// io.Fonts->AddFontFromFileTTF("../../misc/fonts/Cousine-Regular.ttf");
98-
// ImFont* font = io.Fonts->AddFontFromFileTTF("c:\\Windows\\Fonts\\ArialUni.ttf");
99-
// IM_ASSERT(font != nullptr);
100-
101-
// Our state
84+
style.FontSizeBase = 20.0f;
85+
io.Fonts->AddFontFromFileTTF("imgui/misc/fonts/Cousine-Regular.ttf");
86+
10287
ImVec4 clear_color = ImVec4(0.45f, 0.55f, 0.60f, 1.00f);
10388

10489
// Main loop

0 commit comments

Comments
 (0)