Update FontAwesome 6 -> 7
This commit is contained in:
@@ -535,8 +535,9 @@ void imgui_context::initialize_fonts()
|
||||
}
|
||||
}
|
||||
|
||||
font_awesome_regular = utils::mapped_file("assets://Font Awesome 6 Free-Regular-400.otf");
|
||||
font_awesome_solid = utils::mapped_file("assets://Font Awesome 6 Free-Solid-900.otf");
|
||||
assert(font_awesome.empty());
|
||||
font_awesome.emplace_back("assets://Font Awesome 7 Free-Regular-400.otf");
|
||||
font_awesome.emplace_back("assets://Font Awesome 7 Free-Solid-900.otf");
|
||||
|
||||
ImFontConfig config;
|
||||
config.FontDataOwnedByAtlas = false;
|
||||
@@ -550,8 +551,8 @@ void imgui_context::initialize_fonts()
|
||||
|
||||
config.MergeMode = true;
|
||||
config.GlyphMinAdvanceX = 40; // Use if you want to make the icon monospaced
|
||||
io.Fonts->AddFontFromMemoryTTF(const_cast<std::byte *>(font_awesome_regular.data()), font_awesome_regular.size(), constants::gui::font_size_small, &config);
|
||||
io.Fonts->AddFontFromMemoryTTF(const_cast<std::byte *>(font_awesome_solid.data()), font_awesome_solid.size(), constants::gui::font_size_small, &config);
|
||||
for (auto & fa: font_awesome)
|
||||
io.Fonts->AddFontFromMemoryTTF(const_cast<std::byte *>(fa.data()), fa.size(), constants::gui::font_size_small, &config);
|
||||
}
|
||||
|
||||
std::vector<imgui_context::controller_state> imgui_context::read_controllers_state(XrTime display_time)
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include <glm/gtc/quaternion.hpp>
|
||||
#include <imgui.h>
|
||||
#include <implot.h>
|
||||
#include <inplace_vector.hpp>
|
||||
#include <optional>
|
||||
#include <span>
|
||||
#include <unordered_map>
|
||||
@@ -201,8 +202,7 @@ private:
|
||||
bool show_demo_window = true;
|
||||
#endif
|
||||
|
||||
utils::mapped_file font_awesome_regular;
|
||||
utils::mapped_file font_awesome_solid;
|
||||
beman::inplace_vector::inplace_vector<utils::mapped_file, 3> font_awesome;
|
||||
void initialize_fonts();
|
||||
|
||||
std::vector<controller_state> read_controllers_state(XrTime display_time);
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "imgui_internal.h"
|
||||
#include "ui_theme.h"
|
||||
|
||||
#include "IconsFontAwesome6.h"
|
||||
#include "IconsFontAwesome7.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
|
||||
Reference in New Issue
Block a user