mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-03-03 20:46:37 +00:00
Check if font file exists
This commit is contained in:
@@ -304,6 +304,11 @@ extern "C"
|
|||||||
mlx::Error("Font loader: filepath is NULL");
|
mlx::Error("Font loader: filepath is NULL");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!std::filesystem::exists(filepath))
|
||||||
|
{
|
||||||
|
mlx::Error("TTF loader: unable to find file '%'", filepath);
|
||||||
|
return;
|
||||||
|
}
|
||||||
std::filesystem::path file(filepath);
|
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")
|
||||||
{
|
{
|
||||||
@@ -324,6 +329,11 @@ extern "C"
|
|||||||
mlx::Error("Font loader: filepath is NULL");
|
mlx::Error("Font loader: filepath is NULL");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!std::filesystem::exists(filepath))
|
||||||
|
{
|
||||||
|
mlx::Error("TTF loader: unable to find file '%'", filepath);
|
||||||
|
return;
|
||||||
|
}
|
||||||
std::filesystem::path file(filepath);
|
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")
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user