Using Oracle(Sun) JDK6 and trying to move to Oracle JDK7
I am using sun.awt.GraphicsEnvironment
to find all system fonts in order to use them to change pdf font used in my pdf file. Here is the exact code I am using:
GraphicsEnvironment gEnv = GraphicsEnvironment.getLocalGraphicsEnvironment();
// get all system fonts
final Font[] fonts = gEnv.getAllFonts();
After that I will need to get the exact font file path on the system, so I use:
FontManager.getFontPath(true) + "/" +
FontManager.getFileNameForFontName(font_name);
The problem now is that sun.font.FontManager
is no longer a class and has been converted to an interface. I searched online and came up with some solutions that I am not satisfied with and I am looking for other ideas to help solve my problem.
The solutions that I found:
What I need is: *A way to find the exact font file path on the system*. All ideas are welcomed.
You're not saying which JDK you use (Oracle, OpenJDK, ..). Possibly you have
FontManagerFactory.getInstance()
available. Or the inteface implementation Win32FontManager
(if you're on Windows)?