font = FontSets.getFont("SanSerif", Font.PLAIN, 12);
FontRenderContext frc = new FontRenderContext();
double h = font.getStringBounds("abcdefg",frc).getHeight();
double w = font.getStringBounds("abcdefg",frc).getWidth();
FontRenderContext frc = new FontRenderContext();
double h = font.getStringBounds("abcdefg",frc).getHeight();
double w = font.getStringBounds("abcdefg",frc).getWidth();
int iHeight;
FontMetrics curFM = g2.getFontMetrics();
Rectangle2D r2d = curFM.getStringBounds("ddddd",g2);
iWidth = r2d.getwidht();
iHeight = r2d.getHeight();