private int findNextStop(final String aText, final int aStartIndex) { int length = 0; int lastStop = 0; while (true) { final int index = aStartIndex + length; if (index >= aText.length()) return index; final char code = aText.charAt(index); if (code == '\n' || code == '|') return index; final int width = font.substringWidth(aText, aStartIndex, length); if (width >= blockWidth) return lastStop; if (code == ' ') lastStop = index; length++; } }