mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-18 16:21:07 +00:00
Catch exceptions loading bitmap fonts
As now loadBitmapFont() throws exception in case of error, we have to catch the problem to avoid a crash/uncaught exception.
This commit is contained in:
parent
995e09bb60
commit
e4a2b4a1ba
@ -2166,13 +2166,15 @@ she::Font* SkinTheme::loadFont(const char* userFont, const std::string& path)
|
||||
|
||||
// Try to load the font
|
||||
while (rf.next()) {
|
||||
she::Font* f = she::instance()->loadBitmapFont(rf.filename().c_str(), guiscale());
|
||||
if (f) {
|
||||
try {
|
||||
she::Font* f = she::instance()->loadBitmapFont(rf.filename().c_str(), guiscale());
|
||||
if (f->isScalable())
|
||||
f->setSize(8);
|
||||
|
||||
return f;
|
||||
}
|
||||
catch (const std::exception& ex) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
|
Loading…
x
Reference in New Issue
Block a user