mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-01-11 18:57:11 +01:00
Fixed android text bug and updated readme
This commit is contained in:
parent
bd9df6ecf9
commit
dcb6321531
@ -9,8 +9,9 @@ namespace style {
|
|||||||
ImFont* baseFont;
|
ImFont* baseFont;
|
||||||
ImFont* bigFont;
|
ImFont* bigFont;
|
||||||
ImFont* hugeFont;
|
ImFont* hugeFont;
|
||||||
ImVector<ImWchar> ranges;
|
ImVector<ImWchar> baseRanges;
|
||||||
ImFontGlyphRangesBuilder builder;
|
ImVector<ImWchar> bigRanges;
|
||||||
|
ImVector<ImWchar> hugeRanges;
|
||||||
|
|
||||||
#ifndef __ANDROID__
|
#ifndef __ANDROID__
|
||||||
float uiScale = 1.0f;
|
float uiScale = 1.0f;
|
||||||
@ -19,21 +20,34 @@ namespace style {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool loadFonts(std::string resDir) {
|
bool loadFonts(std::string resDir) {
|
||||||
|
ImFontAtlas* fonts = ImGui::GetIO().Fonts;
|
||||||
if (!std::filesystem::is_directory(resDir)) {
|
if (!std::filesystem::is_directory(resDir)) {
|
||||||
spdlog::error("Invalid resource directory: {0}", resDir);
|
spdlog::error("Invalid resource directory: {0}", resDir);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create font range
|
// Create base font range
|
||||||
ImFontAtlas* fonts = ImGui::GetIO().Fonts;
|
ImFontGlyphRangesBuilder baseBuilder;
|
||||||
builder.AddRanges(fonts->GetGlyphRangesDefault());
|
baseBuilder.AddRanges(fonts->GetGlyphRangesDefault());
|
||||||
builder.AddRanges(fonts->GetGlyphRangesCyrillic());
|
baseBuilder.AddRanges(fonts->GetGlyphRangesCyrillic());
|
||||||
builder.BuildRanges(&ranges);
|
baseBuilder.BuildRanges(&baseRanges);
|
||||||
|
|
||||||
|
// Create big font range
|
||||||
|
ImFontGlyphRangesBuilder bigBuilder;
|
||||||
|
const ImWchar bigRange[] = { '.', '9', 0 };
|
||||||
|
bigBuilder.AddRanges(bigRange);
|
||||||
|
bigBuilder.BuildRanges(&bigRanges);
|
||||||
|
|
||||||
|
// Create huge font range
|
||||||
|
ImFontGlyphRangesBuilder hugeBuilder;
|
||||||
|
const ImWchar hugeRange[] = { 'S', 'S', 'D', 'D', 'R', 'R', '+', '+', ' ', ' ', 0 };
|
||||||
|
hugeBuilder.AddRanges(hugeRange);
|
||||||
|
hugeBuilder.BuildRanges(&hugeRanges);
|
||||||
|
|
||||||
// Add bigger fonts for frequency select and title
|
// Add bigger fonts for frequency select and title
|
||||||
baseFont = fonts->AddFontFromFileTTF(((std::string)(resDir + "/fonts/Roboto-Medium.ttf")).c_str(), 16.0f * uiScale, NULL, ranges.Data);
|
baseFont = fonts->AddFontFromFileTTF(((std::string)(resDir + "/fonts/Roboto-Medium.ttf")).c_str(), 16.0f * uiScale, NULL, baseRanges.Data);
|
||||||
bigFont = fonts->AddFontFromFileTTF(((std::string)(resDir + "/fonts/Roboto-Medium.ttf")).c_str(), 45.0f * uiScale);
|
bigFont = fonts->AddFontFromFileTTF(((std::string)(resDir + "/fonts/Roboto-Medium.ttf")).c_str(), 45.0f * uiScale, NULL, bigRanges.Data);
|
||||||
hugeFont = fonts->AddFontFromFileTTF(((std::string)(resDir + "/fonts/Roboto-Medium.ttf")).c_str(), 128.0f * uiScale);
|
hugeFont = fonts->AddFontFromFileTTF(((std::string)(resDir + "/fonts/Roboto-Medium.ttf")).c_str(), 128.0f * uiScale, NULL, hugeRanges.Data);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -354,6 +354,7 @@ Modules in beta are still included in releases for the most part but not enabled
|
|||||||
| frequency_manager | Working | - | OPT_BUILD_FREQUENCY_MANAGER | ✅ | ✅ | ✅ |
|
| frequency_manager | Working | - | OPT_BUILD_FREQUENCY_MANAGER | ✅ | ✅ | ✅ |
|
||||||
| recorder | Working | - | OPT_BUILD_RECORDER | ✅ | ✅ | ✅ |
|
| recorder | Working | - | OPT_BUILD_RECORDER | ✅ | ✅ | ✅ |
|
||||||
| rigctl_server | Working | - | OPT_BUILD_RIGCTL_SERVER | ✅ | ✅ | ⛔ |
|
| rigctl_server | Working | - | OPT_BUILD_RIGCTL_SERVER | ✅ | ✅ | ⛔ |
|
||||||
|
| scanner | Beta | - | OPT_BUILD_SCANNER | ✅ | ✅ | ✅ |
|
||||||
|
|
||||||
# Troubleshooting
|
# Troubleshooting
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user