if ( fd.isUnderline( ) ) { gc.drawLine( (int) ( dX + dXOffset + ins.getLeft( ) ), (int) ( dY + dH * ( i + 1 ) + ins.getTop( ) ), (int) ( dX + dXOffset + ins.getLeft( ) + dW ), (int) ( dY + dH * ( i + 1 ) + ins.getTop( ) ) ); } if ( fd.isStrikethrough( ) ) { gc.drawLine( (int) ( dX + dXOffset + ins.getLeft( ) ), (int) ( dY + dH * ( i + 0.5 ) + ins.getTop( ) ), (int) ( dX + dXOffset + ins.getLeft( ) + dW ), (int) ( dY + dH * ( i + 0.5 ) + ins.getTop( ) ) ); }
	private final void renderHorizontalText( GC gc, Label la, double dX,			double dY )	{		final FontDefinition fd = la.getCaption( ).getFont( );		final Color clrText = (Color) _sxs.getColor( la.getCaption( )				.getColor( ) );		final ITextMetrics itm = new SwtTextMetrics( _sxs, la );		final double dFW = itm.getFullWidth( );		final double dH = itm.getHeight( );		final double dFH = itm.getFullHeight( );		double dXOffset = 0;		double dW = 0;		final Insets ins = la.getInsets( )				.scaledInstance( _sxs.getDpiResolution( ) / 72d );		final HorizontalAlignment ha = la.getCaption( )				.getFont( )				.getAlignment( )				.getHorizontalAlignment( );		final boolean bRightAligned = ha.getValue( ) == HorizontalAlignment.RIGHT;		final boolean bCenterAligned = ha.getValue( ) == HorizontalAlignment.CENTER;		final Rectangle r;		Object tr = null;		// In Linux-Cairo environment, it uses a cascaded transform setting		// policy, not a overriding policy. So we must set a reverse tranforming		// again to restore to original state. see bugzilla 137654.		// This transform object records the reverse tranforming, which is used		// to restore original state.		Object rtr = null;		if ( R31Enhance.isR31Available( ) )		{			r = new Rectangle( 0, 0, (int) dFW, (int) dFH );			tr = R31Enhance.newTransform( _sxs.getDevice( ) );			rtr = R31Enhance.newTransform( _sxs.getDevice( ) );			if ( la.getCaption( ).getFont( ).getRotation( ) != 0 )			{				float rotate = (float) la.getCaption( )						.getFont( )						.getRotation( );				double dAngleInRadians = ( ( -rotate * Math.PI ) / 180.0 );				double dSineTheta = Math.sin( dAngleInRadians );				float tTx = (float) ( dX - dFW / 2 );				float tTy = (float) ( dY - dFH / 2 );				if ( rotate > 0 )					tTy += dFW * Math.abs( dSineTheta );				else					tTx += dFH * Math.abs( dSineTheta );				R31Enhance.translate( gc,						tr,						(float) ( dFW / 2 ),						(float) ( dFH / 2 ) );				R31Enhance.translate( gc, tr, tTx, tTy );				R31Enhance.rotate( gc, tr, -rotate );				R31Enhance.rotate( gc, rtr, rotate );				R31Enhance.translate( gc, rtr, -tTx, -tTy );				R31Enhance.translate( gc,						rtr,						(float) ( -dFW / 2 ),						(float) ( -dFH / 2 ) );			}			else			{				R31Enhance.translate( gc, tr, (float) dX, (float) dY );				R31Enhance.translate( gc, rtr, (float) -dX, (float) -dY );			}			R31Enhance.setTransform( gc, tr );		}		else		{			r = new Rectangle( (int) dX, (int) dY, (int) dFW, (int) dFH );		}		// RENDER THE BACKGROUND		boolean bFullyTransparent = true;		if ( la.getBackground( ) != null )		{			bFullyTransparent = ( ( (ColorDefinition) la.getBackground( ) ).getTransparency( ) == 0 );			R31Enhance.setAlpha( gc, 255 );		}		if ( !bFullyTransparent )		{			final Color clrBackground = (Color) _sxs.getColor( (ColorDefinition) la.getBackground( ) );			final Color clrPreviousBackground = gc.getBackground( );			if ( ( (ColorDefinition) la.getBackground( ) ).isSetTransparency( ) )			{				R31Enhance.setAlpha( gc, (ColorDefinition) la.getBackground( ) );			}			gc.setBackground( clrBackground );			gc.fillRectangle( r );			clrBackground.dispose( );			gc.setBackground( clrPreviousBackground );		}		// RENDER THE TEXT		gc.setForeground( clrText );		R31Enhance.setAlpha( gc, la.getCaption( ).getColor( ) );		final Font f = (Font) _sxs.createFont( fd );		gc.setFont( f );		// R31Enhance.setTextAntialias( gc, 1 ); // SWT.ON		if ( R31Enhance.isR31Available( ) )		{			for ( int i = 0; i < itm.getLineCount( ); i++ )			{				String oText = itm.getLine( i );				dW = gc.textExtent( oText ).x;				if ( bRightAligned )				{					dXOffset = -ins.getLeft( ) + dFW - dW - ins.getRight( );				}				else if ( bCenterAligned )				{					dXOffset = -ins.getLeft( ) + ( dFW - dW ) / 2;				}				gc.drawText( oText,						(int) ( dXOffset + ins.getLeft( ) ),						(int) ( dH * i + ins.getTop( ) ),						true );			}		}		else		{			for ( int i = 0; i < itm.getLineCount( ); i++ )			{				String oText = itm.getLine( i );				dW = gc.textExtent( oText ).x;				if ( bRightAligned )				{					dXOffset = -ins.getLeft( ) + dFW - dW - ins.getRight( );				}				else if ( bCenterAligned )				{					dXOffset = -ins.getLeft( ) + ( dFW - dW ) / 2;				}				gc.drawText( oText,						(int) ( dX + dXOffset + ins.getLeft( ) ),						(int) ( dY + dH * i + ins.getTop( ) ),						true );			}		}		// apply reverse tranforming.		R31Enhance.setTransform( gc, rtr );		// keep this null setting for other platforms.		R31Enhance.setTransform( gc, null );		R31Enhance.disposeTransform( rtr );		R31Enhance.disposeTransform( tr );		f.dispose( );		clrText.dispose( );		itm.dispose( );	}