Content


NTL
Core
WordWrap

WordWrap



Split long string into lines with respect to words and specified maximum allowed line width.

/**
Split string by words so it to fit into specified width
@param str String to be split
@param width Width into which the string to be fit. Should be no less than 32
@param pf Platform font used to render. Cannot be nullptr
@param distance Additional distance between characters
@param [out] lines Resulting lines
@param [out] size Resulting size. Width can be greater than requested one if there is a very long word(s)
@param locale Used locale
@return Whether process was successful or not
@note Line separator in the string should be '\n' character. If '\n\r' or '\r' is used, it should be replaced with '\n' only
*/
bool WordWrap(const String &str, const float width, IPlatformFont *pf, const float distance, StringArray &lines, PointF &size, const std::locale &locale = std::locale());
Namespace: nitisa
Include: Nitisa/Core/Utils.h