From 25fb5285f7cf85f51674aa8c2d800127db8a1b4e Mon Sep 17 00:00:00 2001 From: kbz_8 Date: Wed, 4 Feb 2026 07:23:26 +0100 Subject: [PATCH] fixed issue with default font loading --- runtime/Sources/Core/Bridge.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/runtime/Sources/Core/Bridge.cpp b/runtime/Sources/Core/Bridge.cpp index b2e7560..005cc67 100644 --- a/runtime/Sources/Core/Bridge.cpp +++ b/runtime/Sources/Core/Bridge.cpp @@ -304,12 +304,14 @@ extern "C" mlx::Error("Font loader: filepath is NULL"); return; } - if (!std::filesystem::exists(filepath)) + + std::filesystem::path file(filepath); + if (std::strcmp(filepath, "default") != 0 && filepath !std::filesystem::exists(file)) { mlx::Error("TTF loader: unable to find file '%'", filepath); return; } - std::filesystem::path file(filepath); + if(std::strcmp(filepath, "default") != 0 && file.extension() != ".ttf" && file.extension() != ".tte") { mlx::Error("TTF loader: not a truetype font file '%'", filepath); @@ -329,12 +331,14 @@ extern "C" mlx::Error("Font loader: filepath is NULL"); return; } - if (!std::filesystem::exists(filepath)) + + std::filesystem::path file(filepath); + if (std::strcmp(filepath, "default") != 0 && filepath !std::filesystem::exists(file)) { mlx::Error("TTF loader: unable to find file '%'", filepath); return; } - std::filesystem::path file(filepath); + if(std::strcmp(filepath, "default") != 0 && file.extension() != ".ttf" && file.extension() != ".tte") { mlx::Error("TTF loader: not a truetype font file '%'", filepath);