fd = new FontData(font, graphics.getFontMetrics(font));
fd = new FontData(font, graphics==null?null:graphics.getFontMetrics(font));
public Font getFont(String name, int size, int style) {	String id = getID(name, size, style);	FontData fd = (FontData)(fonts.get(id));	if (fd==null) {		Font font = new Font(name, style, size);		if (font==null) return null; 		fd = new FontData(font, graphics.getFontMetrics(font));		fonts.put(id, fd);	}	return fd.getFont();}