Java - FontMetrics ohne Grafiken
Wie bekomme ich FontMetrics ohne Grafik? Ich möchte FontMetrics in den Konstruktor bekommen, jetzt mache ich das so:
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();