replace kFont with std::string

This commit is contained in:
2019-12-01 15:00:10 +01:00
parent 0ee3f1d125
commit 0905827b8d
11 changed files with 38 additions and 46 deletions

View File

@@ -31,16 +31,14 @@ void NodeText::create()
Node::create();
if (!m_font.empty())
{
char font[64];
sprintf(font, "%s-%d", m_font.c_str(), m_font_size);
font_id = (kFont)const_hash(font);
font_id = fmt::format("{}-{}", m_font, m_font_size);
m_text_mesh.create();
m_text_mesh.update(font_id, m_text);
update_layout();
}
}
void NodeText::set_font(kFont fontID)
void NodeText::set_font(const std::string& fontID)
{
font_id = fontID;
m_text_mesh.create();