Hello ,

This is a more Java question rather than a PDFBox question : ) , but I can't 
find an answer to it.

I am trying to use a system font file in drawing text to a PDF file using 
PDFBox, through the method :
PDTrueTypeFont.loadTTF( PDDocuent pdfFile, File fontFile );

The problem here is that the loadTTF(...) method accepts a (File) object, while 
I can only get the System font as a (Font) object using this code :
GraphicsEnvironment e = GraphicsEnvironment.getLocalGraphicsEnvironment();
Font[] fonts = e.getAllFonts();

Where I get one of the (fonts) objects to use it. Is there a way to convert the 
Font object to File object ?
I am using Mac OS X.


Best regards ,
Hesham 

Reply via email to