how to implement manually string splitting algorithm to fit it into the rectangle.(insert ... or \n where needed) i can calculate the length of the string in pixels.
i have standart std::string and rect struct containing left, top ,width ,height how to split string into words phrases that it size was not larger than rectangle of the given size
returns width of string in pixel
int GetStringWidth(std::string str)