Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: sf::Text ignoring spaces at the end  (Read 2419 times)

0 Members and 1 Guest are viewing this topic.

Contadotempo

  • Full Member
  • ***
  • Posts: 167
  • Firelink Shrine
    • View Profile
sf::Text ignoring spaces at the end
« on: February 07, 2012, 11:00:15 am »
Hello,

sf::Text seems to be ignoring blank spaces I put at the end of a string. When I try to get the Global Bounds's width it always returns the value of the string without the spaces
The problem is shown by the code:

Code: [Select]
#include <SFML/Graphics.hpp>
#include <iostream>

int main()
{
sf::Text text1("Hello this is a string");
sf::Text text2("Hello this is a string    ");

std::cout << "Bounds for text1: " << text1.GetGlobalBounds().Width << std::endl;
std::cout << "Bounds for text2: " << text2.GetGlobalBounds().Width << std::endl;

getchar();
return 0;
}


Is this behaviour intentional?
Is there a workaround?

Using latest commit of SFML,
Windows 7,
ATI Radeon HD4870.

Best Regards.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
sf::Text ignoring spaces at the end
« Reply #1 on: February 07, 2012, 11:09:10 am »
Laurent Gomila - SFML developer

Contadotempo

  • Full Member
  • ***
  • Posts: 167
  • Firelink Shrine
    • View Profile
sf::Text ignoring spaces at the end
« Reply #2 on: February 07, 2012, 11:15:16 am »
Ugh, didn't use the correct terms to search.
I'm sorry I feel stupid.  :oops:

 

anything