Java - FontMetrics sem gráficos

Como obter o FontMetrics sem usar gráficos? Quero obter o FontMetrics no construtor, agora faço desta maneira:

BufferedImage bi = new BufferedImage(5, 5, BufferedImage.TYPE_INT_RGB);
FontMetrics fm = bi.getGraphics().getFontMetrics(font);
int width = fm.stringWidth(pattern);
int height = fm.getHeight();