Fix formatting

This commit is contained in:
Guillaume Meunier
2024-06-22 17:35:25 +02:00
parent 1307115c02
commit 9559f968be
3 changed files with 13 additions and 13 deletions
+1 -1
View File
@@ -859,7 +859,7 @@ void application::initialize()
auto & facet = std::use_facet<boost::locale::info>(loc); auto & facet = std::use_facet<boost::locale::info>(loc);
messages_info.language = facet.language(); messages_info.language = facet.language();
messages_info.country = facet.country(); messages_info.country = facet.country();
messages_info.encoding ="UTF-8"; messages_info.encoding = "UTF-8";
#endif #endif
spdlog::info("Current locale: language {}, country {}, encoding {}", messages_info.language, messages_info.country, messages_info.encoding); spdlog::info("Current locale: language {}, country {}, encoding {}", messages_info.language, messages_info.country, messages_info.encoding);
+11 -11
View File
@@ -307,17 +307,17 @@ void imgui_context::add_chars(std::string_view sv)
} }
#ifdef __ANDROID__ #ifdef __ANDROID__
static std::vector<std::string> find_font(const ImFontGlyphRangesBuilder& glyph_range_builder, const std::string & locale) static std::vector<std::string> find_font(const ImFontGlyphRangesBuilder & glyph_range_builder, const std::string & locale)
{ {
std::u16string wtext; std::u16string wtext;
std::u16string_view wtextview; std::u16string_view wtextview;
for(int i = 0; i < glyph_range_builder.UsedChars.Size; ++i) for (int i = 0; i < glyph_range_builder.UsedChars.Size; ++i)
{ {
std::uint32_t used_chars = glyph_range_builder.UsedChars[i]; std::uint32_t used_chars = glyph_range_builder.UsedChars[i];
if (used_chars == 0) if (used_chars == 0)
continue; continue;
for(int j = 0; j < 32; ++j) for (int j = 0; j < 32; ++j)
{ {
ImWchar c = i * 32 + j; ImWchar c = i * 32 + j;
if (used_chars & (1 << j)) if (used_chars & (1 << j))
@@ -357,7 +357,7 @@ static std::vector<std::string> find_font(const ImFontGlyphRangesBuilder& glyph_
return fonts; return fonts;
} }
#else #else
static std::vector<std::string> find_font(const ImFontGlyphRangesBuilder& glyph_range_builder, const std::string & locale) static std::vector<std::string> find_font(const ImFontGlyphRangesBuilder & glyph_range_builder, const std::string & locale)
{ {
// See https://www.camconn.cc/post/how-to-fontconfig-lib-c/ // See https://www.camconn.cc/post/how-to-fontconfig-lib-c/
@@ -376,13 +376,13 @@ static std::vector<std::string> find_font(const ImFontGlyphRangesBuilder& glyph_
// Add the text to the pattern (to determine appropriate characters) // Add the text to the pattern (to determine appropriate characters)
FcCharSet * charset = FcCharSetCreate(); FcCharSet * charset = FcCharSetCreate();
for(int i = 8; i < glyph_range_builder.UsedChars.Size; ++i) for (int i = 8; i < glyph_range_builder.UsedChars.Size; ++i)
{ {
std::uint32_t used_chars = glyph_range_builder.UsedChars[i]; std::uint32_t used_chars = glyph_range_builder.UsedChars[i];
if (used_chars == 0) if (used_chars == 0)
continue; continue;
for(int j = 0; j < 32; ++j) for (int j = 0; j < 32; ++j)
{ {
ImWchar c = i * 32 + j; ImWchar c = i * 32 + j;
if (used_chars & (1 << j)) if (used_chars & (1 << j))
@@ -448,14 +448,14 @@ void imgui_context::initialize_fonts()
break; break;
} }
for(int i = 0; i < glyph_range_builder.UsedChars.Size; ++i) for (int i = 0; i < glyph_range_builder.UsedChars.Size; ++i)
{ {
std::uint32_t used_chars = glyph_range_builder.UsedChars[i]; std::uint32_t used_chars = glyph_range_builder.UsedChars[i];
if (used_chars == 0) if (used_chars == 0)
continue; continue;
for(int j = 0; j < 32; ++j) for (int j = 0; j < 32; ++j)
{ {
ImWchar c = i * 32 + j; ImWchar c = i * 32 + j;
if (used_chars & (1 << j)) if (used_chars & (1 << j))
@@ -470,7 +470,7 @@ void imgui_context::initialize_fonts()
// Load Fonts // Load Fonts
auto fonts = find_font(glyph_range_builder, application::get_messages_info().language); auto fonts = find_font(glyph_range_builder, application::get_messages_info().language);
for(auto& i: fonts) for (auto & i: fonts)
{ {
spdlog::info("Font {}", i); spdlog::info("Font {}", i);
} }
@@ -485,7 +485,7 @@ void imgui_context::initialize_fonts()
ImFontConfig config; ImFontConfig config;
config.FontDataOwnedByAtlas = false; config.FontDataOwnedByAtlas = false;
for(auto& font: fonts) for (auto & font: fonts)
{ {
spdlog::info("Using font {}", font, application::get_messages_info().language); spdlog::info("Using font {}", font, application::get_messages_info().language);
io.Fonts->AddFontFromFileTTF(font.c_str(), 30, &config, glyph_ranges.Data); io.Fonts->AddFontFromFileTTF(font.c_str(), 30, &config, glyph_ranges.Data);
@@ -502,7 +502,7 @@ void imgui_context::initialize_fonts()
{ {
ImFontConfig config; ImFontConfig config;
config.FontDataOwnedByAtlas = false; config.FontDataOwnedByAtlas = false;
for(auto& font: fonts) for (auto & font: fonts)
{ {
large_font = io.Fonts->AddFontFromFileTTF(font.c_str(), 75, &config, glyph_ranges.Data); large_font = io.Fonts->AddFontFromFileTTF(font.c_str(), 75, &config, glyph_ranges.Data);
config.MergeMode = true; config.MergeMode = true;
+1 -1
View File
@@ -609,7 +609,7 @@ static void ScrollWhenDraggingOnVoid(ImVec2 delta)
XrCompositionLayerQuad scenes::lobby::draw_gui(XrTime predicted_display_time) XrCompositionLayerQuad scenes::lobby::draw_gui(XrTime predicted_display_time)
{ {
for(const auto& [key, server]: application::get_config().servers) for (const auto & [key, server]: application::get_config().servers)
{ {
imgui_ctx->add_chars(server.service.name); imgui_ctx->add_chars(server.service.name);
} }