title: Get font file as a File object or get its path
body: <p>I have a Font object in Java for a font file. I need to convert that object to a File object or get the font file path.</p>
  
  <p>Is there a way to do this?</p>
  
  <hr>
  
  <p>What I'm doing here is calling a method from an external library that loads a font file to use it in writing:</p>
  
  <pre><code>loadTTF(PDDocument pdfFile, File fontfile);
  </code></pre>
  
  <p>So I wanted to let the user choose a font from the ones defined in his operating system using :</p>
  
  <pre><code>GraphicsEnvironment e = GraphicsEnvironment.getLocalGraphicsEnvironment();
  Font[] fonts = e.getAllFonts();
  </code></pre>
  
  <p>Then when the user chooses a font, I pass it to the <code>loadTTF(...)</code> method to load it.</p>
  
  <p>Is there a bad practice here?</p>