for (int i = 0; i < fontData.length; i++) { int fontStyle = fontData[i].getStyle(); if ((fontStyle & SWT.BOLD) == SWT.BOLD) { fontData[i].setStyle(fontStyle ^ SWT.BOLD); } else { fontData[i].setStyle(fontStyle | SWT.BOLD); } } font = new Font(getDevice(), fontData); gc.setFont(font); lineHeight = Math.max(lineHeight, gc.getFontMetrics().getHeight()); gc.setFont(originalFont); font.dispose();
void calculateLineHeight() {	GC gc = getGC();		lineHeight = gc.getFontMetrics().getHeight();		lineEndSpaceWidth = gc.stringExtent(" ").x;	disposeGC(gc);}