Hello,
I think there's a bug with getLocalBounds() method for sf::Text when there are spaces on the beginning or end of the string. I don't know, maybe it's a feature, but I need to get actual text size no matter if there are any spaces at the end, is it possible?
sf::Text text;
text.setCharacterSize(11);
text.setString(" ");
printf("%d\n", (int)text.getLocalBounds().width);
output is 0
I found a solution for this but it's not really nice way of getting actual text size I think
Just add any letter on start and end of the string, get local bounds and then subtract length of these 2 letters.