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

Author Topic: Line Spacing  (Read 4535 times)

0 Members and 1 Guest are viewing this topic.

Foaly

  • Sr. Member
  • ****
  • Posts: 453
    • View Profile
Line Spacing
« on: November 06, 2012, 11:37:34 am »
Hello,
I was wondering if there is a way in SFML to control the spacing between lines in sf::Text. I have a text object that spans over multiple lines. It's created like this:

std::stringstream stream;

for(int i = 0; i < 10; i++)
{
    stream << "Some Text " << i << std::endl;
}

m_Text.setString(stream.str());

I saw that there is a getLineSpacing() function in sf::Font, but I'm not quiet sure if that's the thing I'm looking for, since it's not in sf::Text. So I was wondering is there any way I can control the spacing between lines in sf::Text? And if not is it possible to add such an option?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Line Spacing
« Reply #1 on: November 06, 2012, 11:48:41 am »
No, sf::Text always uses the line spacing defined by the font. Why would you like to change it?
Laurent Gomila - SFML developer

quasius

  • Full Member
  • ***
  • Posts: 166
    • View Profile
Re: Line Spacing
« Reply #2 on: June 26, 2013, 10:36:51 pm »
No, sf::Text always uses the line spacing defined by the font. Why would you like to change it?
Replying to this because it turned up in a search for the same question.  I'd want to change it because the default for the font I'm using is too large.  It seems like a reasonable thing to have access to in the font class.

Phanoo

  • Full Member
  • ***
  • Posts: 136
    • View Profile
Re: Line Spacing
« Reply #3 on: April 26, 2014, 08:23:44 pm »
Hello

I need this feature too, please

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
Re: Line Spacing
« Reply #4 on: April 26, 2014, 09:14:12 pm »
Why not simply edit the font file?  Is there a need to change the line spacing dynamically at runtime?