ecode: Font loading small bug fix.

This commit is contained in:
Martín Lucas Golini
2022-06-08 01:17:20 -03:00
parent b6ac472d73
commit bbecb4cc1b

View File

@@ -2734,10 +2734,11 @@ FontTrueType* App::loadFont( const std::string& name, std::string fontPath,
const std::string& fallback ) {
if ( FileSystem::isRelativePath( fontPath ) )
fontPath = mResPath + fontPath;
if ( fontPath.empty() || !FileSystem::fileExists( fontPath ) )
if ( fontPath.empty() || !FileSystem::fileExists( fontPath ) ) {
fontPath = fallback;
if ( FileSystem::isRelativePath( fontPath ) )
fontPath = mResPath + fontPath;
if ( FileSystem::isRelativePath( fontPath ) )
fontPath = mResPath + fontPath;
}
return FontTrueType::New( name, fontPath );
}