static int drawThoughtCircleText_margin = 10; static void drawThoughtCircleText(BufferedImage bg, BufferedImage img, P p, S text) { Graphics2D g = imageGraphics(bg); g.setColor(Color.white); g.setFont(sansSerif(20)); FontMetrics fm = g.getFontMetrics(); g.drawString(text, p.x-fm.stringWidth(text)/2.0f, p.y+drawThoughtCircleText_margin+fm.getLeading()+fm.getMaxAscent()); g.dispose(); }