protected float textWidthImpl(char buffer[], int start, int stop) {
    Font font = textFont.getFont();
    if (font == null) {
      return super.textWidthImpl(buffer, start, stop);
    }
    // maybe should use one of the newer/fancier functions for this?
    int length = stop - start;
    FontMetrics metrics = g2.getFontMetrics(font);
    return metrics.charsWidth(buffer, start, length);
  }