Java examples for 2D Graphics:Font
get Font Height
//package com.java2s; import java.awt.Font; import java.awt.FontMetrics; import java.awt.Graphics; public class Main { public static int getFontHeight(Graphics offLineBuffer, Font font) { offLineBuffer.setFont(font);/* ww w . j a va2 s .c o m*/ FontMetrics fontmetrics = offLineBuffer.getFontMetrics(); return fontmetrics.getHeight(); } }