c.getGraphics().setColor( oldcolor );
    public void paintText(Context c, int lx, int ly, int ix, int iy, InlineBox inline) {        String text = inline.getSubstring();        Graphics g = c.getGraphics();        //adjust font for current settings        Font oldfont = c.getGraphics().getFont();        c.getGraphics().setFont( inline.getFont() );        Color oldcolor = c.getGraphics().getColor();        c.getGraphics().setColor( inline.color );        Font cur_font = c.getGraphics().getFont();        //LineMetrics lm = cur_font.getLineMetrics( text, ( (Graphics2D)c.getGraphics() ).getFontRenderContext() );        LineMetrics lm = c.getTextRenderer().getLineMetrics(c.getGraphics(), cur_font, text);        //u.p("lm descent = " + lm.getDescent());        iy-= (int)lm.getDescent();                //draw the line        if ( text != null && text.length() > 0 ) {            //c.getGraphics().drawString( text, ix, iy );            c.getTextRenderer().drawString( c.getGraphics(), text, ix, iy );        }        c.getGraphics().setColor( oldcolor );        //draw any text decoration        int stringWidth = (int)Math.ceil(c.getTextRenderer().            getLogicalBounds(c.getGraphics(),             c.getGraphics().getFont(),             text).getWidth());         if ( inline.underline ) {            float down = lm.getUnderlineOffset();            float thick = lm.getUnderlineThickness();            //g.fillRect( ix, iy + (int)down, g.getFontMetrics().stringWidth( text ), (int)thick );            g.fillRect( ix, iy + (int)down, stringWidth, (int)thick );        }        if ( inline.strikethrough ) {            float down = lm.getStrikethroughOffset();            float thick = lm.getStrikethroughThickness();            g.fillRect( ix, iy + (int)down, stringWidth, (int)thick );            //g.fillRect( ix, iy + (int)down, g.getFontMetrics().stringWidth( text ), (int)thick );        }        if ( inline.overline ) {            float down = lm.getAscent();            float thick = lm.getUnderlineThickness();            //g.fillRect( ix, iy - (int)down, g.getFontMetrics().stringWidth( text ), (int)thick );            g.fillRect( ix, iy + (int)down, stringWidth, (int)thick );        }        if ( c.debugDrawFontMetrics() ) {            g.setColor(Color.red);            g.drawLine(ix,iy, ix+inline.width, iy);            iy += (int)Math.ceil(lm.getDescent());            //iy += lm.getDescent();            g.drawLine(ix,iy, ix+inline.width, iy);            //iy -= lm.getDescent();            //iy -= lm.getAscent();            iy -= (int)Math.ceil(lm.getDescent());            iy -= (int)Math.ceil(lm.getAscent());            g.drawLine(ix,iy, ix+inline.width, iy);        }        // restore the old font        c.getGraphics().setFont( oldfont );    }