label text looks compressed

Started by HYXYH, 22 September 2016, 17:26:26

HYXYH

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?

Code (cpp) Select

// 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

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?

HYXYH

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 :)