30#include <sptk5/String.h>
31#include <sptk5/sptk.h>
68 uint32_t m_attributes;
79 explicit CFont(
const String& name =
"arial", uint32_t size = 10, uint32_t color = 0, uint32_t index = 0,
80 uint32_t attributes = 0)
85 , m_attributes(attributes)
96 , m_color(font.m_color)
97 , m_index(font.m_index)
98 , m_attributes(font.m_attributes)
147 std::string
id()
const;
156 :
public std::map<String, CFont*, std::less<>>
188 std::vector<CFont*> m_items;
214 return m_items[index];
222 return m_items[index];
241 return (uint32_t) m_items.size();
Font information.
Definition: CFont.h:44
CFont(const String &name="arial", uint32_t size=10, uint32_t color=0, uint32_t index=0, uint32_t attributes=0)
Constructor.
Definition: CFont.h:79
std::string id() const
Returns unique font id.
uint32_t attributes() const
Returns font attributes.
Definition: CFont.h:137
String name() const
Returns font name.
Definition: CFont.h:105
uint32_t size() const
Returns font size.
Definition: CFont.h:113
uint32_t index() const
Returns font index in the fonts collection.
Definition: CFont.h:129
CFont(const CFont &font)
Copy constructor.
Definition: CFont.h:93
uint32_t color() const
Returns font color.
Definition: CFont.h:121
CFontsMap is a map font names to fonts.
Definition: CFont.h:157
~CFontsMap()
Destructor.
Definition: CFont.h:167
void clear()
Clears the fonts.
CFontsMap()=default
Constructor.
CFontsVector is a map font names to fonts.
Definition: CFont.h:184
CFontsVector()=default
Constructor.
uint32_t size() const
Definition: CFont.h:239
~CFontsVector()
Destructor.
Definition: CFont.h:204
void push_back(CFont *font)
Appends a font to fonts vector.
void clear()
Clears the fonts.
CFont * find(const String &fontName) const
Returns font by its name.
CFont * operator[](uint32_t index)
Returns font by index.
Definition: CFont.h:212
const CFont * operator[](uint32_t index) const
Returns font by index.
Definition: CFont.h:220