mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-01-26 09:34:44 +01:00
Partial unicode support (the proper way), only cyrillic at the moment
This commit is contained in:
parent
6eb8bfc29a
commit
04e54a2d57
@ -10,6 +10,8 @@ namespace style {
|
|||||||
ImFont* baseFont;
|
ImFont* baseFont;
|
||||||
ImFont* bigFont;
|
ImFont* bigFont;
|
||||||
ImFont* hugeFont;
|
ImFont* hugeFont;
|
||||||
|
ImVector<ImWchar> ranges;
|
||||||
|
ImFontGlyphRangesBuilder builder;
|
||||||
|
|
||||||
#ifndef __ANDROID__
|
#ifndef __ANDROID__
|
||||||
float uiScale = 1.0f;
|
float uiScale = 1.0f;
|
||||||
@ -23,9 +25,16 @@ namespace style {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
baseFont = ImGui::GetIO().Fonts->AddFontFromFileTTF(((std::string)(resDir + "/fonts/Roboto-Medium.ttf")).c_str(), 16.0f * uiScale);
|
// Create font range
|
||||||
bigFont = ImGui::GetIO().Fonts->AddFontFromFileTTF(((std::string)(resDir + "/fonts/Roboto-Medium.ttf")).c_str(), 45.0f * uiScale);
|
ImFontAtlas* fonts = ImGui::GetIO().Fonts;
|
||||||
hugeFont = ImGui::GetIO().Fonts->AddFontFromFileTTF(((std::string)(resDir + "/fonts/Roboto-Medium.ttf")).c_str(), 128.0f * uiScale);
|
builder.AddRanges(fonts->GetGlyphRangesDefault());
|
||||||
|
builder.AddRanges(fonts->GetGlyphRangesCyrillic());
|
||||||
|
builder.BuildRanges(&ranges);
|
||||||
|
|
||||||
|
// 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);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user