return 0;
{   Token tokens = tokenMarker.markTokens( lineSegment,line);  int offset = 0; Toolkit toolkit = painter.getToolkit(); Font defaultFont = painter.getFont(); SyntaxStyle[] styles = painter.getStyles();  int width = 0;  for(;;) { byte id = tokens.id; if(id == Token.END) return offset;  if(id == Token.NULL) fm = toolkit.getFontMetrics(defaultFont); else { fm = toolkit.getFontMetrics(styles[id] .getStyledFont(defaultFont)); }  int length = tokens.length;  for(int i = 0; i < length; i++) { char c = segmentArray[segmentOffset + offset + i]; int charWidth; if(c == '\t') charWidth = (int)painter.nextTabStop(width,offset + i) - width; else charWidth = fm.charWidth(c);  if(x - charWidth / 2 < width) return offset + i;  width += charWidth; }  offset += length; tokens = tokens.next; } }
	public int xToOffset(int line, int x)	{		x -= textArea.getHorizontalOffset();		TokenMarker tokenMarker = getTokenMarker();		/* Use painter's cached info for speed */		TextAreaPainter painter = textArea.getPainter();		FontMetrics fm = painter.getFontMetrics();		Segment currentLine = painter.currentLine;		if(painter.currentLineIndex != line)		{			getLineText(line,currentLine);			painter.currentLineIndex = line;		}		if(tokenMarker == null)		{			int offset = currentLine.offset;			int count = currentLine.count;			char[] array = currentLine.array;			int width = 0;			for(int i = 0; i < count; i++)			{				char c = array[i + offset];				int charWidth;				if(c == '\t')					charWidth = (int)painter.nextTabStop(width,i)						- width;				else					charWidth = fm.charWidth(c);				if(x - charWidth / 2 < width)					return i;				width += charWidth;			}			return count;		}		else			return 0;	}