//PEND not updated to new system yet bool ofxTextObject::wrapTextForceLines(int linesN) { if (words.size() > 0) { if (linesN > words.size()) linesN = words.size(); float lineWidth = _getWidthOfWords() * (1.1f / (float)linesN); int curLines = 0; bool bGotLines = false; //soso //keep increasing the line width until we get the desired number of lines. while (!bGotLines) { //curLines = wrapTextX(lineWidth); curLines = wrapTextX(lineWidth); if (curLines == linesN) return true; if (curLines > linesN) return false; lineWidth-=10; columnWidth = lineWidth; //soso } renderDirty = true; return true; //soso } else return false; //soso }
bool TextBlock::_wrapTextForceLines(int linesN){ if (words.size() > 0) { if (linesN > words.size()) linesN = words.size(); float lineWidth = _getWidthOfWords() * (1.1f / (float)linesN); int curLines = 0; bool bGotLines; // keep increasing the line width until we get the desired number of lines. // while (!bGotLines){ curLines = _wrapTextX(lineWidth); if (curLines == linesN) return true; if (curLines > linesN) return false; lineWidth-=10; } } }