1
0
Fork 0

Font: moving text size from font to Text object.

This commit is contained in:
Henrik Hautakoski 2016-05-05 11:04:54 +02:00
parent c74dda1200
commit b2dbee33fb
5 changed files with 31 additions and 16 deletions

View file

@ -35,9 +35,9 @@ public :
Font();
~Font();
bool loadFromFile(const std::string& filename, unsigned int size = 22);
bool loadFromFile(const std::string& filename);
bool loadFromMemory(const void *data, unsigned int size);
bool loadFromMemory(const void *data);
Glyph getGlyph(unsigned int code) const;
@ -67,8 +67,6 @@ protected :
mutable std::map<unsigned char, Glyph> m_charset;
unsigned int m_size; // font size, in pixels. not points.
// Alpha Cache texture.
mutable CacheTexture m_cacheTextureA;

View file

@ -30,11 +30,14 @@ public :
Text();
Text(const std::string text, const Font& font);
Text(const std::string text, unsigned int size, const Font& font);
void setString(const std::string& string);
const std::string& getString() const;
void setCharacterSize(unsigned int size);
unsigned int getCharacteSize() const;
void setFont(const Font& font);
const Font* getFont() const;
@ -66,6 +69,9 @@ private :
// String containing the text.
std::string m_string;
// Character size (in pixels, not points).
unsigned int m_size;
const Font* m_font;
Color m_color;