Added the possibility to configure the font hinting and font anti-aliasing.

MenuBar buttons are now slightly more separated.
When switching between dark and light ui prefers color scheme now pick a dark/light color scheme if the currently set is the default (SpartanJ/ecode#535).
Fix a bug in menu bar pop-up not hiding properly.
This commit is contained in:
Martín Lucas Golini
2025-06-30 02:23:51 -03:00
parent 78e9e81935
commit a79c16ec0a
13 changed files with 196 additions and 6 deletions

View File

@@ -3398,16 +3398,22 @@ FontTrueType* App::loadFont( const std::string& name, std::string fontPath,
if ( fontPath.empty() )
return nullptr;
FontTrueType* font = FontTrueType::New( name );
if ( font->loadFromFile( fontPath ) )
if ( font->loadFromFile( fontPath ) ) {
font->setHinting( mConfig.ui.fontHinting );
font->setAntialiasing( mConfig.ui.fontAntialiasing );
return font;
}
eeSAFE_DELETE( font );
// Failed to load original font? Try to fallback
if ( !fallback.empty() && !wasFallback ) {
if ( !fontPath.empty() && FileSystem::isRelativePath( fontPath ) )
fontPath = mResPath + fontPath;
font = FontTrueType::New( name );
if ( font->loadFromFile( fontPath ) )
if ( font->loadFromFile( fontPath ) ) {
font->setHinting( mConfig.ui.fontHinting );
font->setAntialiasing( mConfig.ui.fontAntialiasing );
return font;
}
eeSAFE_DELETE( font );
}
return nullptr;