4 Commits

Author SHA1 Message Date
6c1400e62c azy, 7h du matin, je sais pas écrire 2026-02-04 07:32:55 +01:00
25fb5285f7 fixed issue with default font loading 2026-02-04 07:32:55 +01:00
Yannis
87059f8ca3 Check if font file exists 2026-02-04 07:32:55 +01:00
db299c6930 Indev (#202) 2026-02-03 12:10:08 +01:00

View File

@@ -304,7 +304,14 @@ extern "C"
mlx::Error("Font loader: filepath is NULL");
return;
}
std::filesystem::path file(filepath);
if (std::strcmp(filepath, "default") != 0 && !std::filesystem::exists(file))
{
mlx::Error("TTF loader: unable to find file '%'", filepath);
return;
}
if(std::strcmp(filepath, "default") != 0 && file.extension() != ".ttf" && file.extension() != ".tte")
{
mlx::Error("TTF loader: not a truetype font file '%'", filepath);
@@ -324,7 +331,14 @@ extern "C"
mlx::Error("Font loader: filepath is NULL");
return;
}
std::filesystem::path file(filepath);
if (std::strcmp(filepath, "default") != 0 && !std::filesystem::exists(file))
{
mlx::Error("TTF loader: unable to find file '%'", filepath);
return;
}
if(std::strcmp(filepath, "default") != 0 && file.extension() != ".ttf" && file.extension() != ".tte")
{
mlx::Error("TTF loader: not a truetype font file '%'", filepath);