Font font = view.getFont(); FontMetrics fm = Toolkit.getDefaultToolkit().getFontMetrics(font);
updateFontMetrics(view);
    public float getSpan(GlyphView view, int p0, int p1,                         TabExpander te, float x)    {      Font font = view.getFont();      FontMetrics fm = Toolkit.getDefaultToolkit().getFontMetrics(font);      Segment txt = view.getText(p0, p1);      int span = Utilities.getTabbedTextWidth(txt, fm, (int) x, te, p0);      return span;    }