I used this system :
- Each time you modify the std::string of the object, the object calculate its sf::String
- The calculation of the sf::String is based on its container.
- For each word of the std::string, get the size of the word, add it to the actual line size. If this is larger than the container, add a new line in the sf::string. Add the word to the sf::string.
This is fast, and the calculation is made only on modifications. By the way, you are keeping your std::string exactly like you typed it (for example you can have choosen to add a new line).