int circleSize = myRandom.nextInt(circleMaxSize) / 2 + circleMaxSize / 2; double circlex = bounds.getMaxX() * myRandom.nextGaussian(); double circley = bounds.getMaxY() * myRandom.nextGaussian();
int circleSize = myRandom.nextInt(circleMaxSize) / 2 + circleMaxSize / 2; double circlex = newAttrString.getMaxX() * (1 + myRandom.nextGaussian()); double circley = newAttrString.getMaxY() * ( 1 + myRandom.nextGaussian());
    public BufferedImage pasteText(BufferedImage background,                                   AttributedString attributedWord)            throws CaptchaException    {        BufferedImage out = copyBackground(background);        Graphics2D pie = pasteBackgroundAndSetTextColor(out, background);        //set font to max in order to retrieve the correct boundaries        Font maxFont = getMaxFont(attributedWord.getIterator());        Rectangle2D bounds = getTextBoundaries(pie, maxFont, attributedWord);        int[] randomDeviation = getRandomDeviation(background, bounds, maxFont);        //draw the string        pie.drawString(attributedWord.getIterator(), randomDeviation[0],                randomDeviation[1]);        //draw the holes        //Composite c = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, .7f);        //pie.setComposite(c);        //Color circleColor = ((Graphics2D)background.getGraphics()).getColor();        //pie.getColor();        pie.setColor(holesColor);        int numberOfHoles = numberOfHolesPerGlyph.intValue()                * attributedWord.getIterator().getEndIndex();        int circleMaxSize = maxFont.getSize() / 3;        if (circleMaxSize == 0)        {            throw new CaptchaException("The font is too small");        }        for (int i = 0 ; i < numberOfHoles ; i++)        {            int circleSize = myRandom.nextInt(circleMaxSize) / 2                    + circleMaxSize / 2;            double circlex = bounds.getMaxX() * myRandom.nextGaussian();            double circley = bounds.getMaxY() * myRandom.nextGaussian();            Ellipse2D circle =                    new Ellipse2D.Double(randomDeviation[0] + circlex,                            randomDeviation[1] - maxFont.getSize() / 2                    + circley, circleSize, circleSize);            pie.fill(circle);        }        pie.dispose();        return out;    }