int width = fm.charsWidth(txt.array, txt.offset, txt.count);
Rectangle bounds = a instanceof Rectangle ? (Rectangle) a : a.getBounds(); TabExpander expander = view.getTabExpander(); int width = Utilities.getTabbedTextWidth(txt, fm, bounds.x, expander, view.getStartOffset());
    public Shape modelToView(GlyphView view, int pos, Position.Bias b,                             Shape a)      throws BadLocationException    {      Element el = view.getElement();      Font font = view.getFont();      FontMetrics fm = view.getContainer().getFontMetrics(font);      Segment txt = view.getText(el.getStartOffset(), pos);      int width = fm.charsWidth(txt.array, txt.offset, txt.count);      int height = fm.getHeight();      Rectangle bounds = a.getBounds();      Rectangle result = new Rectangle(bounds.x + width, bounds.y,                                       bounds.x + width, height);      return result;    }