impr: Nicer font registering API

This commit is contained in:
WerWolv
2025-07-28 17:50:04 +02:00
parent a40c420b70
commit 46b13b6606
4 changed files with 35 additions and 25 deletions

View File

@@ -12,7 +12,8 @@
namespace hex::fonts {
void registerFonts();
void registerUIFonts();
void registerMergeFonts();
namespace loader {
bool loadFonts();
@@ -26,11 +27,8 @@ IMHEX_LIBRARY_SETUP("Fonts") {
for (auto &path : romfs::list("lang"))
hex::ContentRegistry::Language::addLocalization(nlohmann::json::parse(romfs::get(path).string()));
hex::ImHexApi::Fonts::registerFont("hex.fonts.font.default");
hex::ImHexApi::Fonts::registerFont("hex.fonts.font.hex_editor");
hex::ImHexApi::Fonts::registerFont("hex.fonts.font.code_editor");
hex::fonts::registerFonts();
hex::fonts::registerUIFonts();
hex::fonts::registerMergeFonts();
hex::EventImHexStartupFinished::subscribe([] {
hex::fonts::loader::loadFonts();