title: How to get list of font names from Java
body: <p>In Java we can create a Font object as such:</p>
  
  <pre><code>new Font("Helvetica", Font.PLAIN, 12);
  </code></pre>
  
  <p>My question is how do we get the entire list of font names from Java, for example "Helvetica" which we can use it as one the argument for the Font constructor?</p>
  
  <p>I tried the following, but I can't find "Helvetica" in all of the lists.</p>
  
  <pre><code>    GraphicsEnvironment ge;  
      ge = GraphicsEnvironment.getLocalGraphicsEnvironment();  
  
      String[] names = ge.getAvailableFontFamilyNames();
      Font[] allFonts = ge.getAllFonts();
  
      for(int x=0; x&lt;names.length; x++)
          System.out.println(names[x]);
  
      for(int x=0; x&lt;allFonts.length; x++){           
          System.out.println(allFonts[x].getName());
          System.out.println(allFonts[x].getFontName());
          System.out.println(allFonts[x].getFamily());
          System.out.println(allFonts[x].getPSName());
      }
  </code></pre>
  
  <hr>
  
  <p><strong>Edit:</strong> More importantly, I also want to know what  is the first attribute call in Font constructor<code>new Font("What attribute is this?", Font.PLAIN, 12)</code></p>
  
  <p><strong>Q: Is it a fontName, family, fontFace, name or what?</strong></p>