Tuesday, July 24, 2007

JAVA Printing vs Font size

You can get the height of line from font. Example according code below.
public int print(Graphics g, PageFormat pf, int pageIndex){
Font font = new Font("Serif", Font.PLAIN, 14);
FontMetrics metrics = g.getFontMetrics(font);
int lineHeight = metrics.getHeight();
}

No comments: