Prerequisite Checklist
Describe your feature request here
Right now, if you use sf::Text::setLineSpacing(float) and sf::Text::setLetterSpacing(float),
you risk getting blurry images.
As an example: above text with setLetterSpacing(1.1), below text with setLetterSpacing(1.0).

I propose two functions, setLineSpacingRounding(bool) and setLetterSpacingRounding(bool) (the getters as well, if needed...?) to ensure that the lineSpacing and letterSpacing variables resulting from using the values set by "setLineSpacing and setLetterSpacing" are integers, to prevent the blur you can see here.
Link to the relevant code:
|
const float letterSpacing = (whitespaceWidth / 3.0f) * (m_letterSpacingFactor - 1.0f); |
Use Cases
Preventing blurry text.
API Example
text_line->setLetterSpacing(1.1);
// Prevent horizontal blurring
text_line->setLetterSpacingRounding(true);
text_paragraph->setLetterSpacing(1.1);
text_paragraph->setLineSpacing(1.1);
// Prevent horizontal blurring
text_paragraph->setLetterSpacingRounding(true);
// Prevent vertical blurring
text_paragraph->setLineSpacingRounding(true);
Prerequisite Checklist
Describe your feature request here
Right now, if you use sf::Text::setLineSpacing(float) and sf::Text::setLetterSpacing(float),
you risk getting blurry images.
As an example: above text with setLetterSpacing(1.1), below text with setLetterSpacing(1.0).

I propose two functions, setLineSpacingRounding(bool) and setLetterSpacingRounding(bool) (the getters as well, if needed...?) to ensure that the lineSpacing and letterSpacing variables resulting from using the values set by "setLineSpacing and setLetterSpacing" are integers, to prevent the blur you can see here.
Link to the relevant code:
SFML/src/SFML/Graphics/Text.cpp
Line 634 in 17a3f86
Use Cases
Preventing blurry text.
API Example