class EE::Graphics::FontManager

Overview

The Font Manager is a singleton class that manages all the instance of fonts instanciated. And releases the font instances automatically. So the user doesn’t need to release any font instance. More…

#include <fontmanager.hpp>

class FontManager: public EE::System::ResourceManager {
public:
    // construction

    virtual ~FontManager();

    // methods

    Graphics::Font* add(Graphics::Font* Font);
    Font* getColorEmojiFont() const;
    void setColorEmojiFont(Graphics::Font* font);
    Font* getEmojiFont() const;
    void setEmojiFont(Font* newEmojiFont);
    const std::vector<Font*>& getFallbackFonts() const;
    bool hasFallbackFonts() const;
    bool addFallbackFont(Font* fallbackFont);
    bool removeFallbackFont(Font* fallbackFont);
    FontHinting getHinting() const;
    void setHinting(FontHinting hinting);
    FontAntialiasing getAntialiasing() const;
    void setAntialiasing(FontAntialiasing antialiasing);
};

Inherited Members

public:
    // methods

    virtual T* add(T* resource);
    bool remove(T* resource, bool remove = true);
    bool removeById(const String::HashType& id, bool remove = true);
    bool removeByName(const std::string& name, bool remove = true);
    T* getByName(const std::string& name);
    T* getById(const String::HashType& id);
    Uint32 getCount();
    Uint32 getCount(const std::string& name);
    Uint32 getCount(const String::HashType& id);
    bool exists(const std::string& name);
    bool existsId(const String::HashType& id);
    void destroy();
    void printNames();
    UnorderedMap<String::HashType, T*>& getResources();
    const bool& isDestroying() const;

    template <typename Predicate>
    void each(Predicate pred) const;

    template <typename Predicate>
    void each(Predicate pred);

    template <typename Predicate>
    T* findIf(Predicate pred) const;

    template <typename Predicate>
    T* findIf(Predicate pred);

Detailed Documentation

The Font Manager is a singleton class that manages all the instance of fonts instanciated. And releases the font instances automatically. So the user doesn’t need to release any font instance.

Methods

Graphics::Font* add(Graphics::Font* Font)

Adds a new font to the manager.