practical-tools-for-simple-design icon indicating copy to clipboard operation
practical-tools-for-simple-design copied to clipboard

Some font can't have more then one text.

Open HEKEPOIU opened this issue 11 months ago • 3 comments

Problem

Same As Title, i think it is AssetStore Bug. but I don't know why Inter font can work well

Steps to reproduce

  1. Clone commit 823926c(main branch)
  2. Add NotoSans-Regular font Download From Google Fonts
  3. Change App::Start implementation to
void App::Start() {
    LOG_TRACE("Start");

    m_Giraffe->SetDrawable(
        std::make_shared<Util::Image>("../assets/sprites/giraffe.png"));
    m_Giraffe->SetZIndex(5);
    m_Giraffe->Start();

    auto textTest = std::make_shared<Util::GameObject>();
    textTest->SetDrawable(std::make_shared<Util::Text>(
        "../assets/fonts/NotoSans-Regular.ttf", 50, "1000",
        Util::Color::FromRGB(255, 255, 255)));
    auto textTest1 = std::make_shared<Util::GameObject>();
    textTest1->SetDrawable(std::make_shared<Util::Text>(
        "../assets/fonts/NotoSans-Regular.ttf", 50, "2222",
        Util::Color::FromRGB(255, 255, 255)));

    m_Root.AddChild(m_Giraffe);
    m_Root.AddChild(m_Cat);
    m_Root.AddChild(textTest);
    m_Root.AddChild(textTest1);

    m_CurrentState = State::UPDATE;
}
  1. That only show the 1000 Text(The first create Text).

Expected behavior

show 1000 and 2222 text.

PTSD version

main commit 823926c952ddbd068dc74909bf0663a00573d248

Operating system/version

ubuntu 22.04.3

CMake version

3.28.3

CMakeCache.txt

CMakeCache.txt

OpenGL Info

[info] OpenGL Info
 [info]   Vendor: NVIDIA Corporation
 [info]   Renderer: NVIDIA GeForce RTX 3060 Laptop GPU/PCIe/SSE2
 [info]   Version: 4.1.0 NVIDIA 535.161.07
 [info]   GLSL Version: 4.10 NVIDIA via Cg compiler

HEKEPOIU avatar Mar 31 '24 19:03 HEKEPOIU

I can reproduce this issue on my machine, however I can't find the root cause of this

NOOBDY avatar Apr 01 '24 04:04 NOOBDY

I've tried Reddit Mono from Google Fonts and it has the same issue

NOOBDY avatar Apr 01 '24 04:04 NOOBDY

I think I will remove the store from Util::Text for now but I will leave this open

NOOBDY avatar Apr 01 '24 04:04 NOOBDY