SFML community forums

Help => Graphics => Topic started by: Foaly on November 06, 2012, 11:37:34 am

Title: Line Spacing
Post by: Foaly 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?
Title: Re: Line Spacing
Post by: Laurent 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?
Title: Re: Line Spacing
Post by: quasius 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.
Title: Re: Line Spacing
Post by: Phanoo on April 26, 2014, 08:23:44 pm
Hello

I need this feature too, please
Title: Re: Line Spacing
Post by: Ixrec 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?