使用Oracle(Sun)JDK6并尝试迁移到Oracle JDK7
我sun.awt.GraphicsEnvironment用来查找所有系统字体,以便使用它们来更改我的pdf文件中使用的pdf字体.这是我正在使用的确切代码:
GraphicsEnvironment gEnv = GraphicsEnvironment.getLocalGraphicsEnvironment();
// get all system fonts
final Font[] fonts = gEnv.getAllFonts();
Run Code Online (Sandbox Code Playgroud)
之后我需要在系统上获得确切的字体文件路径,所以我使用:
FontManager.getFontPath(true) + "/" +
FontManager.getFileNameForFontName(font_name);
Run Code Online (Sandbox Code Playgroud)
现在的问题是,sun.font.FontManager它不再是一个类,而是已经转换为接口.我在网上搜索并提出了一些我不满意的解决方案,我正在寻找其他想法来帮助解决我的问题.
我发现的解决方案:
我需要的是:*一种在系统上找到确切字体文件路径的方法*.欢迎所有想法.
我正在尝试清理我的构建环境,并发现了一些关于使用Sun专有API的警告.
[javac] /workspace/<path-to-files>/Handler.java:18: warning: sun.net.www.protocol.http.Handler is Sun proprietary API and may be removed in a future release
[javac] public class Handler extends sun.net.www.protocol.http.Handler {
[javac] ^
[javac] /workspace/<path-to-files>/HttpClient.java:16: warning: sun.net.www.http.HttpClient is Sun proprietary API and may be removed in a future release
[javac] public class HttpClient extends sun.net.www.http.HttpClient {
[javac]
[javac] /workspace/<path-to-files>/HttpURLConnection.java:19: warning: sun.net.www.protocol.http.HttpURLConnection is Sun proprietary API and may be removed in a future release
[javac] public class HttpURLConnection extends sun.net.www.protocol.http.HttpURLConnection {
[javac] ^
Run Code Online (Sandbox Code Playgroud)
和...
[javac] /workspace/<path-to-files>/JavaFile.java:17: warning: sun.misc.BASE64Decoder …Run Code Online (Sandbox Code Playgroud)