Hello ,
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 ... So i can pass it to another method.
Is there a way to do this ?
Thanks ...
---------------------------------------------------------- Edit: More explanation :
What i'm doing here is calling a method from an external library that loads a font file to use it in writing :
loadTTF(PDDocument pdfFile, File fontfile);
So i wanted to let the user choose a font from the ones defined in his operating system using :
GraphicsEnvironment e = GraphicsEnvironment.getLocalGraphicsEnvironment();
Font[] fonts = e.getAllFonts();
Then when the user chooses a font from them i pass it to the loadTTF(...) method to load it. Is there a bad practice here ?