Buggy code:
if ( gdip ) { drawRunBackgroundGDIP ( run , gdipGraphics , rect , selectionStart , selectionEnd , alpha , gdipSelBackground , hasSelection ) ; } else { drawRunBackground ( run , hdc , rect , selectionStart , selectionEnd , selBackground , hasSelection ) ; } } } drawX += run . width ; } int baseline = Math . max ( 0 , this . ascent ) ; int lineUnderlinePos = 0 ; for ( int i = 0 ; i < ( lineRuns . length ) ; i ++ ) { baseline = Math . max ( baseline , lineRuns [ i ] . ascent ) ; lineUnderlinePos = Math . min ( lineUnderlinePos , lineRuns [ i ] . underlinePos ) ; } RECT borderClip = null ; RECT underlineClip = null ; RECT strikeoutClip = null ; RECT pRect = null ; drawX = alignmentX ; for ( int i = 0 ; i < ( lineRuns . length ) ; i ++ ) { TextLayout . StyleItem run = lineRuns [ i ] ; TextStyle style = run . style ; boolean hasAdorners = ( style != null ) && ( ( ( style . underline ) || ( style . strikeout ) ) || ( ( style . borderStyle ) != ( SWT . NONE ) ) ) ; if ( ( run . length ) == 0 ) continue ; if ( ( drawX > ( ( clip . x ) + ( clip . width ) ) ) && ( ! hasAdorners ) ) break ; if ( ( ( drawX + ( run . width ) ) >= ( clip . x ) ) || hasAdorners ) { boolean skipTab = ( run . tab ) && ( ! hasAdorners ) ; if ( ( ( ! skipTab ) && ( ( ! ( run . lineBreak ) ) || ( run . softBreak ) ) ) && ( ! ( ( style != null ) && ( ( style . metrics ) != null ) ) ) ) { OS . SetRect ( rect , drawX , drawY , ( drawX + ( run . width ) ) , ( drawY + lineHeight ) ) ; if ( gdip ) { int hFont = getItemFont ( run ) ; if ( hFont != lastHFont ) { lastHFont = hFont ; if ( gdipFont != 0 ) Gdip . Font_delete ( gdipFont ) ; int oldFont = OS . SelectObject ( hdc , hFont ) ; gdipFont = Gdip . Font_new ( hdc , hFont ) ; OS . SelectObject ( hdc , oldFont ) ; if ( gdipFont == 0 ) SWT . error ( ERROR_NO_HANDLES ) ; if ( ! ( Gdip . Font_IsAvailable ( gdipFont ) ) ) { Gdip . Font_delete ( gdipFont ) ; gdipFont = 0 ; } } int gdipFg = gdipForeground ; if ( ( ( style != null ) && ( style . underline ) ) && ( ( style . underlineStyle ) == ( SWT . UNDERLINE_LINK ) ) ) { if ( gdipLinkColor == 0 ) gdipLinkColor = createGdipBrush ( linkColor , alpha ) ; gdipFg = gdipLinkColor ; } <START_BUG> if ( gdipFont != 0 ) { <END_BUG> pRect = drawRunTextGDIP ( gdipGraphics , run , rect , gdipFont , baseline , gdipFg , gdipSelForeground , selectionStart , selectionEnd , alpha ) ; } else { int fg = ( ( ( style != null ) && ( style . underline ) ) && ( ( style . underlineStyle ) == ( SWT . UNDERLINE_LINK ) ) ) ? linkColor : foreground ; pRect = drawRunTextGDIPRaster ( gdipGraphics , run , rect , baseline , fg , selForeground , selectionStart , selectionEnd ) ; } underlineClip = drawUnderlineGDIP ( gdipGraphics , x , ( drawY + baseline ) , lineUnderlinePos , ( drawY + lineHeight ) , lineRuns , i , gdipFg , gdipSelForeground , underlineClip , pRect , selectionStart , selectionEnd , alpha ) ; strikeoutClip = drawStrikeoutGDIP ( gdipGraphics , x , ( drawY + baseline ) , lineRuns , i , gdipFg , gdipSelForeground , strikeoutClip , pRect , selectionStart , selectionEnd , alpha ) ; borderClip = drawBorderGDIP ( gdipGraphics , x , drawY , lineHeight , lineRuns , i , gdipFg , gdipSelForeground , borderClip , pRect , selectionStart , selectionEnd , alpha ) ; } else { int fg = ( ( ( style != null ) && ( style . underline ) ) && ( ( style . underlineStyle ) == ( SWT . UNDERLINE_LINK ) ) ) ? linkColor : foreground ; pRect = drawRunText ( hdc , run , rect , baseline , fg , selForeground , selectionStart , selectionEnd ) ; underlineClip = drawUnderline ( hdc , x , ( drawY + baseline ) , lineUnderlinePos , ( drawY + lineHeight ) , lineRuns , i , fg , selForeground , underlineClip , pRect , selectionStart , selectionEnd ) ; strikeoutClip = drawStrikeout ( hdc , x , ( drawY + baseline ) , lineRuns , i , fg , selForeground , strikeoutClip , pRect , selectionStart , selectionEnd ) ; borderClip = drawBorder ( hdc , x , drawY , lineHeight , lineRuns , i , fg , selForeground , borderClip , pRect , selectionStart , selectionEnd ) ; } } } drawX += run . width ; } } if ( gdipSelBackground != 0 ) Gdip . SolidBrush_delete ( gdipSelBackground ) ; if ( gdipSelForeground != 0 ) Gdip . SolidBrush_delete ( gdipSelForeground ) ;

Fix:
if ( ( gdipFont != 0 ) && ( ! ( run . analysis . fNoGlyphIndex ) ) ) {