98 m_underline = underline;
108 m_strikeout = strikeout;
128 std::string s_convert;
129 std::stringstream ss;
131 s_convert = m_family;
134 s_convert +=
"," + ss.str();
137 s_convert += toString(m_bold);
139 s_convert += toString(m_italic);
141 s_convert += toString(m_underline);
143 s_convert += toString(m_strikeout);
145 s_convert += toString(m_kerning);
152 std::vector<std::string> strings;
153 std::istringstream f(font);
155 while (std::getline(f, s,
','))
157 strings.push_back(s);
160 if(strings.empty() || strings.size() > 7)
163 m_family = strings[0];
164 m_pointSize = std::atoi(strings[1].c_str());
165 m_bold = toBool(strings[2]);
166 m_italic = toBool(strings[3]);;
167 m_underline = toBool(strings[4]);;
168 m_strikeout = toBool(strings[5]);;
169 m_kerning = toBool(strings[6]);;
174 return flag ?
"true" :
"false";
179 if(str.compare(
"true") == 0)
bool isBold()
Returns true if font use bold, false otherwise.
bool isStrikeout()
Returns true if font use strikeout, false otherwise.
void setStrikeout(bool strikeout)
Sets font with strikeout style.
void setKerning(bool kerning)
Sets font with kerning style.
int getPointSize()
Returns point size of the font.
virtual bool toBool(std::string str)
State string to boolean.
void setPointSize(int point)
Sets point size of the font.
virtual void fromString(std::string font)
Sets this object state from a string.
void setBold(bool bold)
Sets font with bold style.
void setFamily(std::string family)
Returns font family name.
void setUnderline(bool underline)
Sets font with underline style.
bool isItalic()
Returns true if font use italic, false otherwise.
bool isUnderline()
Returns true if font use underline, false otherwise.
virtual ~Font()
Destructor.
void setItalic(bool italic)
Sets font with italic style.
std::string getFamily()
Sets font family name.
virtual std::string toString()
Serialize font object.
bool isKerning()
Returns true if font use kerning, false otherwise.