working on texts and fonts

This commit is contained in:
2024-10-27 01:14:07 +02:00
parent 3aaa5df929
commit 028cb57ff4
31 changed files with 414 additions and 187 deletions

View File

@@ -153,8 +153,14 @@ namespace mlx
font = std::make_shared<Font>("default", dogica_ttf, scale);
else
font = std::make_shared<Font>(filepath, scale);
if(!m_font_registry.IsFontKnown(font))
for(auto& gs : m_graphics)
{
if(gs)
gs->GetScene().BindFont(font);
}
if(m_font_registry.IsFontKnown(font))
return;
font->BuildFont();
m_font_registry.RegisterFont(font);
}