sys: Replaced many helper functions with libwolv

This commit is contained in:
WerWolv
2023-03-12 18:27:29 +01:00
parent e958934a22
commit 0dafb3d230
62 changed files with 263 additions and 1091 deletions

View File

@@ -16,6 +16,8 @@
#include <ui/pattern_drawer.hpp>
#include <wolv/utils/guards.hpp>
namespace {
std::vector<std::fs::path> userFolders;
@@ -566,14 +568,14 @@ namespace hex::plugin::builtin {
static void loadFontSettings() {
std::fs::path fontFile = ContentRegistry::Settings::read("hex.builtin.setting.font", "hex.builtin.setting.font.font_path", "");
if (!fs::exists(fontFile) || !fs::isRegularFile(fontFile))
if (!wolv::io::fs::exists(fontFile) || !wolv::io::fs::isRegularFile(fontFile))
fontFile.clear();
// If no custom font has been specified, search for a file called "font.ttf" in one of the resource folders
if (fontFile.empty()) {
for (const auto &dir : fs::getDefaultPaths(fs::ImHexPath::Resources)) {
auto path = dir / "font.ttf";
if (fs::exists(path)) {
if (wolv::io::fs::exists(path)) {
log::info("Loading custom front from {}", hex::toUTF8String(path));
fontFile = path;