mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-03-03 20:46:37 +00:00
fixed issue with default font loading
This commit is contained in:
@@ -304,12 +304,14 @@ extern "C"
|
|||||||
mlx::Error("Font loader: filepath is NULL");
|
mlx::Error("Font loader: filepath is NULL");
|
||||||
return;
|
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);
|
mlx::Error("TTF loader: unable to find file '%'", filepath);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
std::filesystem::path file(filepath);
|
|
||||||
if(std::strcmp(filepath, "default") != 0 && file.extension() != ".ttf" && file.extension() != ".tte")
|
if(std::strcmp(filepath, "default") != 0 && file.extension() != ".ttf" && file.extension() != ".tte")
|
||||||
{
|
{
|
||||||
mlx::Error("TTF loader: not a truetype font file '%'", filepath);
|
mlx::Error("TTF loader: not a truetype font file '%'", filepath);
|
||||||
@@ -329,12 +331,14 @@ extern "C"
|
|||||||
mlx::Error("Font loader: filepath is NULL");
|
mlx::Error("Font loader: filepath is NULL");
|
||||||
return;
|
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);
|
mlx::Error("TTF loader: unable to find file '%'", filepath);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
std::filesystem::path file(filepath);
|
|
||||||
if(std::strcmp(filepath, "default") != 0 && file.extension() != ".ttf" && file.extension() != ".tte")
|
if(std::strcmp(filepath, "default") != 0 && file.extension() != ".ttf" && file.extension() != ".tte")
|
||||||
{
|
{
|
||||||
mlx::Error("TTF loader: not a truetype font file '%'", filepath);
|
mlx::Error("TTF loader: not a truetype font file '%'", filepath);
|
||||||
|
|||||||
Reference in New Issue
Block a user