event = renderer.getLineStyleData(lineOffset, line);
StyledTextEvent event = renderer.getLineStyleData(lineOffset, line); StyleRange [] styles = new StyleRange [0];
int [] getBidiSegmentsCompatibility(String line, int lineOffset) {	StyledTextEvent event;	StyleRange [] styles = new StyleRange [0];	int lineLength = line.length();	if (!bidiColoring) {		return new int[] {0, lineLength};	}	event = renderer.getLineStyleData(lineOffset, line);	if (event != null) {		styles = event.styles;	}	if (styles.length == 0) {		return new int[] {0, lineLength};	}	int k=0, count = 1;	while (k < styles.length && styles[k].start == 0 && styles[k].length == lineLength) {		k++;	}	int[] offsets = new int[(styles.length - k) * 2 + 2];	for (int i = k; i < styles.length; i++) {		StyleRange style = styles[i];		int styleLineStart = Math.max(style.start - lineOffset, 0);		int styleLineEnd = Math.max(style.start + style.length - lineOffset, styleLineStart);		styleLineEnd = Math.min (styleLineEnd, line.length ());		if (i > 0 && count > 1 &&			((styleLineStart >= offsets[count-2] && styleLineStart <= offsets[count-1]) ||			 (styleLineEnd >= offsets[count-2] && styleLineEnd <= offsets[count-1])) &&			 style.similarTo(styles[i-1])) {			offsets[count-2] = Math.min(offsets[count-2], styleLineStart);			offsets[count-1] = Math.max(offsets[count-1], styleLineEnd);		} else {			if (styleLineStart > offsets[count - 1]) {				offsets[count] = styleLineStart;				count++;			}			offsets[count] = styleLineEnd;			count++;		}	}	// add offset for last non-colored segment in line, if any	if (lineLength > offsets[count-1]) {		offsets [count] = lineLength;		count++;	}			if (count == offsets.length) {		return offsets;	}	int [] result = new int [count];	System.arraycopy (offsets, 0, result, 0, count);	return result;}