int iStyle = ( fdCurrent.isBold( ) ) ? SWT.BOLD : SWT.NORMAL; iStyle |= ( fdCurrent.isItalic( ) ) ? SWT.ITALIC : iStyle;
int iStyle = ( fdCurrent.isSetBold( ) && fdCurrent.isBold( ) ) ? SWT.BOLD : SWT.NORMAL; iStyle |= ( fdCurrent.isSetItalic( ) && fdCurrent.isItalic( ) ) ? SWT.ITALIC : iStyle;
	public void paintControl( PaintEvent pe )	{		Font fSize = null;		Font fCurrent = null;		Color cFore = null;		Color cBack = null;		GC gc = pe.gc;		Font fOld = gc.getFont( );		if ( !this.isEnabled( ) )		{			cFore = Display.getCurrent( ).getSystemColor( SWT.COLOR_DARK_GRAY );			cBack = Display.getCurrent( )					.getSystemColor( SWT.COLOR_WIDGET_BACKGROUND );		}		else		{			cBack = Display.getCurrent( )					.getSystemColor( SWT.COLOR_LIST_BACKGROUND );			if ( cdCurrent != null && bUseColor )			{				cFore = new Color( this.getDisplay( ),						cdCurrent.getRed( ),						cdCurrent.getGreen( ),						cdCurrent.getBlue( ) );			}			else			{				cFore = new Color( this.getDisplay( ), 0, 0, 0 );			}		}		gc.setForeground( cFore );		gc.setBackground( cBack );		gc.fillRectangle( 0, 0, this.getSize( ).x, this.getSize( ).y );		if ( fdCurrent != null )		{			// Handle styles			int iStyle = ( fdCurrent.isBold( ) ) ? SWT.BOLD : SWT.NORMAL;			iStyle |= ( fdCurrent.isItalic( ) ) ? SWT.ITALIC : iStyle;			String sFontName = fdCurrent.getName( );			if ( !bUseSize )			{				gc.setClipping( 2, 2, this.getSize( ).x - 40, 26 );				fCurrent = new Font( this.getDisplay( ),						fdCurrent.getName( ),						fOld.getFontData( )[0].getHeight( ),						iStyle );			}			else			{				fCurrent = new Font( this.getDisplay( ),						fdCurrent.getName( ),						(int) fdCurrent.getSize( ),						iStyle );			}			gc.setFont( fCurrent );			// Calculate the location to render text			int iStartX = 5;			int iStartY = 3;			if ( bUseAlignment )			{				if ( fdCurrent.getAlignment( )						.getHorizontalAlignment( )						.equals( HorizontalAlignment.LEFT_LITERAL ) )				{					iStartX = 5;				}				else if ( fdCurrent.getAlignment( )						.getHorizontalAlignment( )						.equals( HorizontalAlignment.CENTER_LITERAL ) )				{					iStartX = this.getSize( ).x							/ 2							- ( getStringWidth( gc, sFontName ).x / 2 );				}				else if ( fdCurrent.getAlignment( )						.getHorizontalAlignment( )						.equals( HorizontalAlignment.RIGHT_LITERAL ) )				{					iStartX = this.getSize( ).x							- getStringWidth( gc, sFontName ).x;				}				if ( fdCurrent.getAlignment( )						.getVerticalAlignment( )						.equals( VerticalAlignment.TOP_LITERAL ) )				{					iStartY = 3;				}				else if ( fdCurrent.getAlignment( )						.getVerticalAlignment( )						.equals( VerticalAlignment.CENTER_LITERAL ) )				{					iStartY = ( this.getSize( ).y / 2 );					if ( bUseSize )					{						iStartY -= ( getStringWidth( gc, sFontName ).y / 2 );					}					else					{						iStartY -= 15;					}				}				else if ( fdCurrent.getAlignment( )						.getVerticalAlignment( )						.equals( VerticalAlignment.BOTTOM_LITERAL ) )				{					iStartY = this.getSize( ).y;					if ( bUseSize )					{						iStartY -= ( getStringWidth( gc, sFontName ).y );					}					else					{						iStartY -= 30;					}				}			}			gc.drawText( sFontName, iStartX, iStartY );			if ( fdCurrent.isUnderline( ) )			{				gc.drawLine( iStartX, iStartY						+ getStringWidth( gc, sFontName ).y						- gc.getFontMetrics( ).getDescent( ), iStartX						+ getStringWidth( gc, sFontName ).x						- gc.getFontMetrics( ).getDescent( ), iStartY						+ getStringWidth( gc, sFontName ).y						- gc.getFontMetrics( ).getDescent( ) );			}			if ( fdCurrent.isStrikethrough( ) )			{				gc.drawLine( iStartX,						iStartY + ( getStringWidth( gc, sFontName ).y / 2 ) + 1,						iStartX + getStringWidth( gc, sFontName ).x,						iStartY + ( getStringWidth( gc, sFontName ).y / 2 ) + 1 );			}			if ( !bUseSize )			{				gc.setClipping( 1, 1, this.getSize( ).x, this.getSize( ).y );				fSize = new Font( this.getDisplay( ),						"Sans-Serif", fOld.getFontData( )[0].getHeight( ), SWT.NORMAL ); //$NON-NLS-1$				gc.setFont( fSize );				String sizeString = "(" + String.valueOf( fdCurrent.getSize( ) ) + ")"; //$NON-NLS-1$ //$NON-NLS-2$				Point pt = gc.textExtent( sizeString );				gc.drawText( sizeString, this.getSize( ).x						- pt.x						- this.getBorderWidth( )						- 2, ( this.getSize( ).y - pt.y ) / 2 - 1 );				fSize.dispose( );			}			fCurrent.dispose( );		}		if ( this.isEnabled( ) )		{			cFore.dispose( );		}		gc.setFont( fOld );	}