mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-10-01 10:40:20 +03:00
migrate fonts to scoped resource ownership
- replace FontManager with per-ResourceScope FontService instances - publish font factories into explicit or default resource scopes - import default resources into UI scene scopes unless explicitly disabled - keep related font faces strongly owned without hot-path weak_ptr locking - add cached glyph advance queries without creating texture pages - fix font picker preview ownership, cleanup, and rapid switching - selectively evict TextLayout cache entries when referenced fonts unload - document FontService, ResourceCatalog, and cache invalidation semantics - migrate examples, tools, benchmarks, and tests to the scoped font API - expand coverage for font ownership, texture release, and layout caching
This commit is contained in:
@@ -276,7 +276,7 @@ EE_MAIN_FUNC int main( int argc, char* argv[] ) {
|
||||
FontTrueType* fontMono = nullptr;
|
||||
if ( fontPath && FileSystem::fileExists( fontPath.Get() ) ) {
|
||||
FileInfo file( fontPath.Get() );
|
||||
fontMono = FontTrueType::New( "monospace" );
|
||||
fontMono = FontTrueType::New( "monospace" ).get();
|
||||
if ( fontMono->loadFromFile( file.getFilepath() ) ) {
|
||||
FontFamily::loadFromRegular( fontMono );
|
||||
} else {
|
||||
@@ -284,7 +284,7 @@ EE_MAIN_FUNC int main( int argc, char* argv[] ) {
|
||||
}
|
||||
}
|
||||
if ( fontMono == nullptr ) {
|
||||
fontMono = FontTrueType::New( "monospace" );
|
||||
fontMono = FontTrueType::New( "monospace" ).get();
|
||||
fontMono->loadFromFile( resPath + "fonts/DejaVuSansMonoNerdFontComplete.ttf" );
|
||||
FontFamily::loadFromRegular( fontMono, "DejaVuSansMono" );
|
||||
}
|
||||
@@ -301,9 +301,9 @@ EE_MAIN_FUNC int main( int argc, char* argv[] ) {
|
||||
? fallbackFontPathF.Get()
|
||||
: resPath + "fonts/DroidSansFallbackFull.ttf" );
|
||||
if ( FileSystem::fileExists( fallbackFontPath ) ) {
|
||||
FontTrueType* fallbackFont = FontTrueType::New( "fallback-font" );
|
||||
FontTrueType* fallbackFont = FontTrueType::New( "fallback-font" ).get();
|
||||
if ( fallbackFont->loadFromFile( fallbackFontPath ) )
|
||||
FontManager::instance()->addFallbackFont( fallbackFont );
|
||||
defaultResourceScope().getFontService().addFallbackFont( fallbackFont );
|
||||
}
|
||||
|
||||
Float realMaxFPS = maxFPS.Get() ? maxFPS.Get() : currentDisplay->getRefreshRate();
|
||||
|
||||
Reference in New Issue
Block a user