int newLineWidth = textWidth(line, logicalLineOffset, visualLineOffset, visualLineLength + 1, styles, startX, gc, fontData);
int newLineWidth = getTextWidth(line, logicalLineOffset, visualLineOffset, visualLineLength + 1, styles, startX, gc, fontData);
private int[] wrapLine(String line, int logicalLineOffset, int visualLineOffset, int startX, int width, int numChars, StyleRange[] styles, GC gc, FontData fontData) {	int lineLength = line.length();	int lineWidth = 0;	int visualLineLength;		numChars = Math.min(numChars, lineLength - visualLineOffset);			    visualLineLength = getWordStart(line, visualLineOffset, numChars);	// find a word that is within the client area. make sure at least one 	// character is on each line so that line wrap algorithm terminates.    if (visualLineLength > 0) {		lineWidth = textWidth(line, logicalLineOffset, visualLineOffset, visualLineLength, styles, startX, gc, fontData);		if (lineWidth >= width) {					while (visualLineLength > 1 && lineWidth >= width) {			    visualLineLength = getWordStart(line, visualLineOffset, visualLineLength);			    lineWidth = textWidth(line, logicalLineOffset, visualLineOffset, visualLineLength, styles, startX, gc, fontData);			}		}		else		if (lineWidth < width) {			while (visualLineOffset + visualLineLength < lineLength) {			    int newLineLength = getWordEnd(line, visualLineOffset, visualLineLength);			    int newLineWidth = textWidth(line, logicalLineOffset, visualLineOffset, newLineLength, styles, startX, gc, fontData);			    // would next word be beyond client area?			    if (newLineWidth >= width) {			        break;			    }			    else {			        visualLineLength = newLineLength;			        lineWidth = newLineWidth;			    }			}		}    }    if (visualLineLength <= 0) {        // no complete word fits on the line. either first word was not within        // estimated number of characters or it was beyond the line width even         // though it was within numChars.        visualLineLength = numChars;        lineWidth = textWidth(line, logicalLineOffset, visualLineOffset, visualLineLength, styles, startX, gc, fontData);        if (lineWidth >= width) {		    while (visualLineLength > 1 && lineWidth >= width) {    	    	visualLineLength--;	    	    lineWidth = textWidth(line, logicalLineOffset, visualLineOffset, visualLineLength, styles, startX, gc, fontData);		    }        }        else        if (lineWidth < width) {			while (visualLineOffset + visualLineLength < lineLength) {	   			int newLineWidth = textWidth(line, logicalLineOffset, visualLineOffset, visualLineLength + 1, styles, startX, gc, fontData);			    if (newLineWidth >= width) {			        break;			    }			    else {			        visualLineLength++;			        lineWidth = newLineWidth;			    }		    }        }	}	return new int[] {visualLineLength, lineWidth};}