8 #ifndef META_OCEAN_CV_FONTS_FONT_MANAGER_H
9 #define META_OCEAN_CV_FONTS_FONT_MANAGER_H
56 bool registerFont(
const std::string& fontFile, std::string* familyName =
nullptr, std::string* styleName =
nullptr);
75 bool registerFont(
const void* fontMemory,
const size_t fontMemorySize, std::string* familyName =
nullptr, std::string* styleName =
nullptr);
87 SharedFont font(
const std::string& familyName,
const unsigned int size,
const std::string& styleName = std::string(),
const unsigned int dpi = 72u);
95 bool hasFont(
const std::string& familyName,
const std::string& styleName = std::string())
const;
108 std::vector<std::string>
styleNames(
const std::string& familyName)
const;
114 inline bool isValid()
const;
This class implements the manager for all fonts.
Definition: FontManager.h:36
bool isValid() const
Returns whether this manager is valid and ready to use.
Definition: FontManager.h:142
std::vector< std::string > styleNames(const std::string &familyName) const
Returns the style names of all registered fonts with specified family name.
size_t registerFonts(const std::string &fontDirectory)
Registers all font files located in a specified directory.
std::vector< std::string > familyNames() const
Returns the family names of all registered fonts.
FontManager()
Creates a new manager for fonts.
bool registerFont(const std::string &fontFile, std::string *familyName=nullptr, std::string *styleName=nullptr)
Registers a new font by a given font file.
~FontManager()
Destructs the FontManager object.
static std::string systemDefaultFontFamily(std::string *styleName=nullptr)
Returns the family name of the system's default font.
size_t registerSystemFonts()
Registers all fonts available on the system.
SharedFont font(const std::string &familyName, const unsigned int size, const std::string &styleName=std::string(), const unsigned int dpi=72u)
Registers a new font by a given font file which is already in memory.
bool hasFont(const std::string &familyName, const std::string &styleName=std::string()) const
Returns whether a specific font is registered.
bool registerFont(const void *fontMemory, const size_t fontMemorySize, std::string *familyName=nullptr, std::string *styleName=nullptr)
Registers a new font by a given font file already stored in memory.
std::unique_ptr< FTFontManager > ftFontManager_
The actual implementation of the font manager.
Definition: FontManager.h:139
This template class is the base class for all singleton objects.
Definition: Singleton.h:71
std::shared_ptr< Font > SharedFont
Definition of a shared font pointer.
Definition: Font.h:27
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15