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* bigFont;
|
||||
ImFont* hugeFont;
|
||||
ImVector<ImWchar> ranges;
|
||||
ImFontGlyphRangesBuilder builder;
|
||||
ImVector<ImWchar> baseRanges;
|
||||
ImVector<ImWchar> bigRanges;
|
||||
ImVector<ImWchar> hugeRanges;
|
||||
|
||||
#ifndef __ANDROID__
|
||||
float uiScale = 1.0f;
|
||||
@ -19,21 +20,34 @@ namespace style {
|
||||
#endif
|
||||
|
||||
bool loadFonts(std::string resDir) {
|
||||
ImFontAtlas* fonts = ImGui::GetIO().Fonts;
|
||||
if (!std::filesystem::is_directory(resDir)) {
|
||||
spdlog::error("Invalid resource directory: {0}", resDir);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Create font range
|
||||
ImFontAtlas* fonts = ImGui::GetIO().Fonts;
|
||||
builder.AddRanges(fonts->GetGlyphRangesDefault());
|
||||
builder.AddRanges(fonts->GetGlyphRangesCyrillic());
|
||||
builder.BuildRanges(&ranges);
|
||||
// Create base font range
|
||||
ImFontGlyphRangesBuilder baseBuilder;
|
||||
baseBuilder.AddRanges(fonts->GetGlyphRangesDefault());
|
||||
baseBuilder.AddRanges(fonts->GetGlyphRangesCyrillic());
|
||||
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
|
||||
baseFont = fonts->AddFontFromFileTTF(((std::string)(resDir + "/fonts/Roboto-Medium.ttf")).c_str(), 16.0f * uiScale, NULL, ranges.Data);
|
||||
bigFont = fonts->AddFontFromFileTTF(((std::string)(resDir + "/fonts/Roboto-Medium.ttf")).c_str(), 45.0f * uiScale);
|
||||
hugeFont = fonts->AddFontFromFileTTF(((std::string)(resDir + "/fonts/Roboto-Medium.ttf")).c_str(), 128.0f * uiScale);
|
||||
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, NULL, bigRanges.Data);
|
||||
hugeFont = fonts->AddFontFromFileTTF(((std::string)(resDir + "/fonts/Roboto-Medium.ttf")).c_str(), 128.0f * uiScale, NULL, hugeRanges.Data);
|
||||
|
||||
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 | ✅ | ✅ | ✅ |
|
||||
| recorder | Working | - | OPT_BUILD_RECORDER | ✅ | ✅ | ✅ |
|
||||
| rigctl_server | Working | - | OPT_BUILD_RIGCTL_SERVER | ✅ | ✅ | ⛔ |
|
||||
| scanner | Beta | - | OPT_BUILD_SCANNER | ✅ | ✅ | ✅ |
|
||||
|
||||
# Troubleshooting
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user