mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-11 22:53:34 +00:00
pushing for vavaas to debug
This commit is contained in:
@@ -148,20 +148,22 @@ namespace mlx
|
||||
void Application::LoadFont(const std::filesystem::path& filepath, float scale)
|
||||
{
|
||||
MLX_PROFILE_FUNCTION();
|
||||
std::shared_ptr<Font> font;
|
||||
if(filepath.string() == "default")
|
||||
font = std::make_shared<Font>("default", dogica_ttf, scale);
|
||||
else
|
||||
font = std::make_shared<Font>(filepath, scale);
|
||||
std::shared_ptr<Font> font = m_font_registry.GetFont(filepath, scale);
|
||||
if(!font)
|
||||
{
|
||||
if(filepath.string() == "default")
|
||||
font = std::make_shared<Font>("default", dogica_ttf, scale);
|
||||
else
|
||||
font = std::make_shared<Font>(filepath, scale);
|
||||
font->BuildFont();
|
||||
m_font_registry.RegisterFont(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);
|
||||
}
|
||||
|
||||
void Application::TexturePut(Handle win, Handle img, int x, int y)
|
||||
|
||||
@@ -27,6 +27,9 @@ namespace mlx
|
||||
void GraphicsSupport::StringPut(int x, int y, std::uint32_t color, std::string str)
|
||||
{
|
||||
MLX_PROFILE_FUNCTION();
|
||||
if(str.empty())
|
||||
return;
|
||||
|
||||
Vec4f vec_color = {
|
||||
static_cast<float>((color & 0x000000FF)) / 255.f,
|
||||
static_cast<float>((color & 0x0000FF00) >> 8) / 255.f,
|
||||
|
||||
Reference in New Issue
Block a user