MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / getFont

Method getFont

src/Core/Engine/ResourceManager.cpp:80–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78 }
79
80 std::shared_ptr<Graphics::Font> ResourceManager::getFont(const std::string& path)
81 {
82 if (m_fonts.find(path) == m_fonts.end())
83 {
84 std::shared_ptr<Graphics::Font> tempFont = std::make_shared<Graphics::Font>();
85 const System::LoaderResult loadResult
86 = System::Path(path).load(System::Loaders::fontLoader, *tempFont);
87 Debug::Log->debug(
88 "[ResourceManager] Loading <Font> {} from {}", path, loadResult.path());
89
90 if (loadResult.success())
91 m_fonts[path] = move(tempFont);
92 else
93 throw Exceptions::FontNotFound(
94 path, System::MountablePath::StringPaths(), EXC_INFO);
95 }
96 return m_fonts[path];
97 }
98
99 void ResourceManagedObject::removeResourceManager()
100 {

Callers 2

Shapes.cppFile · 0.45
updateTextAndGeometryMethod · 0.45

Calls 8

PathClass · 0.85
FontNotFoundClass · 0.85
debugMethod · 0.80
pathMethod · 0.80
findMethod · 0.45
endMethod · 0.45
loadMethod · 0.45
successMethod · 0.45

Tested by

no test coverage detected