int fontStyle = SWT.BOLD; int height = 1200; FontData[] fds = font.getFontData (); for (FontData fd: fds) { fd.setStyle (fontStyle); fd.setHeight ((fd.getHeight () * height + 500) / 1000); } newFont = new Font(font.getDevice (), fds);
但这并不适用于“Andale Mono”,例如。
Font Font=新字体(fontFamilyName,fontStyle,fontSize);