public Rectangle2D.Float getBounds() {
        // lazy load the bounds as the calculation is very expensive
        if (bounds == null) {
            // word bounds build from child word bounds.
            for (WordText word : words) {
                if (bounds == null) {
                    bounds = new Rectangle2D.Float();
                    bounds.setRect(word.getBounds());
                } else {
                    bounds.add(word.getBounds());
                }
            }
            // empty line text check, return empty bound.
            if (bounds == null) {
                bounds = new Rectangle2D.Float();
            }
        }
        return bounds;
    }