label text looks compressed
« on: 22 September 2016, 17:26:26 »
I try to create sf::Text and tgui::Label with same font and character size, but they actually have different character size, tgui::Label looks compressed. What I made wrong?

//      sf::Text justText;
        justText.setString("sf::Text HELLO");
        justText.setFont(font);
        justText.setCharacterSize(18);
        justText.setStyle(sf::Text::Style::Regular);
        justText.setPosition(50, Game::windowHeight/2);

        tgui::Label::Ptr label = theme->load("label");
        label->setText(" tgui::Label HELLO");
        label->setFont(font);
        label->setTextSize(18);
        label->setPosition(((justText.getGlobalBounds().width + 50) / Game::windowWidth) * 1000 + 3, 510);
        Game::gui.add(label);
 


*

texus

  • *****
  • 1161
    • View Profile
    • Texus's Blog
Re: label text looks compressed
« Reply #1 on: 22 September 2016, 17:34:59 »
I can't reproduce this (with the DejaVuSans font).
Could you write minimal code (a main function that I can just copy-paste and run) and attach the font you are using?

Re: label text looks compressed
« Reply #2 on: 22 September 2016, 17:56:47 »
Oh, when I wrote minimal code I found that all works perfectly 0_o It seems that I made a mistake somewhere else in my code. Sorry for false alarm :)