Skip to content

Commit

Permalink
Initialize FontPicker in GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
nieznanysprawiciel committed Nov 17, 2024
1 parent 933265e commit e2cbadd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion swGUI/Core/System/GUISystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "swGraphicAPI/Loaders/SoilTextureLoader/SoilTextureLoader.h"
#include "swGraphicAPI/Assets/TextAsset/Loader/FontLoader.h"
#include "swGraphicAPI/Assets/TextAsset/Loader/FontAssetCreator.h"
#include "swGraphicAPI/Assets/TextAsset/Loader/FontPicker.h"

#include "swInputLibrary/InputCore/Debugging/EventCapture.h"

Expand Down Expand Up @@ -357,10 +358,13 @@ ReturnResult GUISystem::ResourceManagerInitImpl ( ResourceManager* resourceMan
{
m_pathsManager = m_resourceManager->GetPathsManager();

FontPicker picker;
picker.RegisterSearchPath( "$(SystemFonts)" );

// GUI needs Textures loader to work.
///< @todo What to do if user adds his own Texture loader? We must avoid conflicts between them.
resourceManager->RegisterLoader( std::make_shared< SoilTextureLoader >() );
resourceManager->RegisterLoader( std::make_shared< FreeTypeLoader >() );
resourceManager->RegisterLoader( std::make_shared< FreeTypeLoader >( std::move( picker ) ) );
resourceManager->RegisterAssetCreator( FontCreator::CreateCreator() );

return Success::True;
Expand Down

0 comments on commit e2cbadd

Please sign in to comment.