* @return The index through which layout was actually completed.
*/
private int sizeFirstWordNextText(final LineText lineText, final int start,
final int end) {
int size = 0;
LineText nextText = lineText;
int whitespaceWidth = getCharWidth(nextText, ' ');
/* First see if there is additional text in the current item. Remember
* that faux small-caps breaks up the text item. */
CharSequence text = nextText.inlineText();
for (int i = end + 1; i < text.length(); i++) {
final char c = text.charAt(i);
if (forcesLineBreak(c) || allowsLineBreak(c)) {
return size;
}
size += charWidth(nextText, c, whitespaceWidth);
}
while (true) {
nextText = nextText.nextContiguousLineText();
if (nextText == null) {
return size;
}
text = nextText.inlineText();
whitespaceWidth = getCharWidth(nextText, ' ');
for (int i = 0; i < text.length(); i++) {
final char c = text.charAt(i);
if (forcesLineBreak(c) || allowsLineBreak(c)) {
return size;