title: Is there a maximum font size for Java Graphics2D?
body: <p>I am creating image tiles in Java, and require to create very large texts (font sizes over 200,000...) However, it seems that when the font size reaches over a certain threshold, the Graphics engine in Java (JDK1.6.0.18) no longer draws the string correctly.
  On my Win7/64 environment it seems I can only print Helvetica characters up to 27915 pixel size.</p>
  
  <p>Is there a way around this? How can I draw such large characters? Am I doing something wrong? Is this a known limitation?</p>
  
  <p>A sample application:</p>
  
  <pre><code>    import java.awt.*;
      import java.awt.image.*;
      import java.io.*;
      import com.sun.image.codec.jpeg.*;
  
      public class FontTest {
  
  
  
  public static void main(String[] args) throws Exception {
          BufferedImage image = new BufferedImage(1000,1000,BufferedImage.TYPE_INT_RGB);
          Graphics2D g = Zoomer.getGraphics(image);
  
          int fontsize = 27916;
          Font font = new Font("Helvetica",Font.PLAIN,fontsize);
          g.setFont(font);
          g.setColor(Color.YELLOW);
  
          g.drawString("Z", 5, 990);
  
          JPEGImageEncoder jpeg = JPEGCodec.createJPEGEncoder(new FileOutputStream(new File("image."+fontsize+".jpg"),false));
          JPEGEncodeParam param = jpeg.getDefaultJPEGEncodeParam(image);
          jpeg.encode(image);
          System.out.println("Ready with fontsize:"+fontsize);
      }
  </code></pre>
  
  <p>Any image up to 27915 displays the left bottom part of the Z correctly, but for 27915 and higher, it displays it backward somehow.</p>
  
  <p>Sample of the wrong image (with the yellow to the left i/o the right: <a href="http://www.beyondtrees.com/test/img/image.27916.jpg" rel="nofollow">size=27,916</a></p>