- lines.clear();
- float font_size=style->get_font()->get_default_size();
- string::size_type start=0;
- while(1)
- {
- string::size_type newline=text.find('\n', start);
-
- Line line;
- line.start=start;
- line.length=(newline==string::npos ? text.size() : newline)-start;
- line.width=static_cast<unsigned>(style->get_font()->get_string_width(text.substr(line.start, line.length))*font_size);
- lines.push_back(line);
-
- if(newline==string::npos)
- break;
- start=newline+1;
- }