Add check for OS to get font

For some reason in Windows, the root directory is /terravisor, but in Linux it's /terravisor/build. Idk why it is that way in Windows.
This commit is contained in:
Jack 2024-08-28 21:12:19 -04:00
parent fa24633a9e
commit af7fa08016
1 changed files with 5 additions and 1 deletions

View File

@ -21,8 +21,12 @@ void ApplyUIScaling(GLFWwindow* window) {
ImGuiIO& io = ImGui::GetIO();
io.Fonts->Clear();
std::cout << "Current Path: " << std::filesystem::current_path() << std::endl;
#ifdef _WIN32
io.Fonts->AddFontFromFileTTF("imgui/misc/fonts/JetBrainsMono/JetBrainsMono-Medium.ttf", 8.0f * scale);
#else
io.Fonts->AddFontFromFileTTF("../imgui/misc/fonts/JetBrainsMono/JetBrainsMono-Medium.ttf", 8.0f * scale);
#endif
io.Fonts->Build();
}