public FontMetrics getFontMetrics(Font font, JComponent comp)
  {
    if(font == null)
      throw new NullPointerException("font param must not"
                                     + " be null");
    if(font.equals(lastFont) && fontMetrics != null)
      return fontMetrics;
    lastFont = font;
    lastStyledFont = new Font(font.getFamily(),
                              (bold ? Font.BOLD : 0)
                              | (italic ? Font.ITALIC : 0),
                              font.getSize());
    //fontMetrics = Toolkit.getDefaultToolkit().getFontMetrics(lastStyledFont);
    fontMetrics = comp.getFontMetrics(lastStyledFont);
    return fontMetrics;
  }