code: private Graphics2D initGraphics(BufferedImage img)
  	{
  		Graphics2D g = img.createGraphics();
  		g.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
  		g.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE);
  		if (options.antialias)
  			g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
  
  		g.setFont(font);
  
  		if (options.debug)
  		{
  			int color = 0x666666;
  			for (int i = 0; i < img.getWidth(); i += 25)
  			{
  				if (i % 500 == 0)
  					color = 0x333333;
  				else if (i % 100 == 0)
  					color = 0x777777;
  				else
  					color = 0xBBBBBB;
  				g.setColor(new Color(color));
  				g.drawLine(i, 0, i, img.getWidth());
  				g.drawLine(0, i, img.getHeight(), i);
  			}
  		}
  
  		g.setColor(options.debug ? Color.BLACK : Color.WHITE);
  
  		return g;
  	}
docs: Initializes the {@link Graphics2D} object. Sets the font and the color for the graphics.<br>
  If debug mode, will also draw a grid on the image.
  
  @param img the img
  @return the graphics2 d