mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-07-10 02:55:22 +02:00
Backend abstraction + added android support + partial high DPI scaling
This commit is contained in:
@ -11,15 +11,21 @@ namespace style {
|
||||
ImFont* bigFont;
|
||||
ImFont* hugeFont;
|
||||
|
||||
#ifndef __ANDROID__
|
||||
float uiScale = 1.0f;
|
||||
#else
|
||||
float uiScale = 3.0f;
|
||||
#endif
|
||||
|
||||
bool loadFonts(std::string resDir) {
|
||||
if (!std::filesystem::is_directory(resDir)) {
|
||||
spdlog::error("Invalid resource directory: {0}", resDir);
|
||||
return false;
|
||||
}
|
||||
|
||||
baseFont = ImGui::GetIO().Fonts->AddFontFromFileTTF(((std::string)(resDir + "/fonts/Roboto-Medium.ttf")).c_str(), 16.0f);
|
||||
bigFont = ImGui::GetIO().Fonts->AddFontFromFileTTF(((std::string)(resDir + "/fonts/Roboto-Medium.ttf")).c_str(), 45.0f);
|
||||
hugeFont = ImGui::GetIO().Fonts->AddFontFromFileTTF(((std::string)(resDir + "/fonts/Roboto-Medium.ttf")).c_str(), 128.0f);
|
||||
baseFont = ImGui::GetIO().Fonts->AddFontFromFileTTF(((std::string)(resDir + "/fonts/Roboto-Medium.ttf")).c_str(), 16.0f * uiScale);
|
||||
bigFont = ImGui::GetIO().Fonts->AddFontFromFileTTF(((std::string)(resDir + "/fonts/Roboto-Medium.ttf")).c_str(), 45.0f * uiScale);
|
||||
hugeFont = ImGui::GetIO().Fonts->AddFontFromFileTTF(((std::string)(resDir + "/fonts/Roboto-Medium.ttf")).c_str(), 128.0f * uiScale);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user