g.drawChars(buffer, offset, 1, pixelX, pixelY + ascent); pixelX += metrics.charWidth(buffer[offset]);
++len; pixelWidth += metrics.charWidth(buffer[offset]);
  public static final int drawTabbedText(Segment s, int x, int y, Graphics g,                                         TabExpander e, int startOffset)  {    // This buffers the chars to be drawn.    char[] buffer = s.array;    // The current x and y pixel coordinates.    int pixelX = x;    int pixelY = y;    // The font metrics of the current selected font.    FontMetrics metrics = g.getFontMetrics();    int ascent = metrics.getAscent();    for (int offset = s.offset; offset < (s.offset + s.count); ++offset)      {	switch (buffer[offset])	  {	  case '\t':	    // In case we have a tab, we just 'jump' over the tab.	    // When we have no tab expander we just use the width of 'm'.	    if (e != null)	      pixelX = (int) e.nextTabStop((float) pixelX,					   startOffset + offset - s.offset);	    else	      pixelX += metrics.charWidth(' ');	    break;	  case '\n':	    // In case we have a newline, we must draw	    // the buffer and jump on the next line.	    g.drawChars(buffer, offset, 1, pixelX, y);	    pixelY += metrics.getHeight();	    pixelX = x;	    break;	  default:	    // Here we draw the char.	    g.drawChars(buffer, offset, 1, pixelX, pixelY + ascent);	    pixelX += metrics.charWidth(buffer[offset]);	    break;	  }      }    return pixelX;  }