Simple SFML GUI  0.2a
FontManager.hpp
1 /*
2  * FontManager.hpp
3  *
4  * Created on: 17.06.2017
5  * Author: jakub
6  */
7 
8 #ifndef SRC_FONTMANAGER_HPP_
9 #define SRC_FONTMANAGER_HPP_
10 
11 #include <SFML/Graphics/Font.hpp>
12 #include <map>
13 #include <string>
14 #include <memory>
15 #include <iostream>
16 
17 class FontManager {
18 public:
19  static const std::shared_ptr<sf::Font>& get(const sf::String& name);
20  static void set(const sf::String& path, const sf::String& name, bool asDefault = false);
21  static void set(const std::shared_ptr<sf::Font>& f, const sf::String& name);
22 
23  static const std::shared_ptr<sf::Font>& getDefaultFont();
24  static void setDefaultFont(const std::shared_ptr<sf::Font>& f);
25  static void clear();
26 
27 private:
28  static std::map<sf::String, std::shared_ptr<sf::Font>> fontMap;
29  static std::shared_ptr<sf::Font> defaultFont;
30 
31  FontManager() {}
32 };
33 
34 #endif /* SRC_FONTMANAGER_HPP_ */
Definition: FontManager.hpp:17