afreechart/src/main/java/org/afree/chart/text/TextFragment.java
/**
     * Calculates the dimensions of the text fragment.
     * 
     * @param canvas
     *            the graphics device.
     * 
     * @return The width and height of the text.
     */
Calculates the dimensions of the text fragment.

@param canvas
the graphics device.

@return The width and height of the text.
Calculates the dimensions of the text fragment . @param canvas the graphics device . @return The width and height of the text .
public Size2D calculateDimensions(final Canvas canvas) {
        Paint paint = PaintUtility.createPaint(Paint.ANTI_ALIAS_FLAG, paintType, font);
        return new Size2D(TextUtilities.getTextWidth(text, paint), 
                TextUtilities.getTextHeight(paint));
    }
public Size2D calculateDimensions ( final Canvas canvas ) { Paint paint = PaintUtility . createPaint ( Paint . ANTI_ALIAS_FLAG , paintType , font ) ; return new Size2D ( TextUtilities . getTextWidth ( text , paint ) , TextUtilities . getTextHeight ( paint ) ) ; }
Calculates the dimensions of the text fragment.
Calculates the dimensions of the text fragment .
//performance tuning //        RectShape rec = TextUtilities.getTextBounds(text, paint); //        return new Size2D(rec.getWidth(), rec.getHeight());