📜  如何在java代码示例中加载字体

📅  最后修改于: 2022-03-11 14:52:12.198000             🧑  作者: Mango

代码示例2
try {
     GraphicsEnvironment ge = 
         GraphicsEnvironment.getLocalGraphicsEnvironment();
     ge.registerFont(Font.createFont(Font.TRUETYPE_FONT, new File("A.ttf")));
} catch (IOException|FontFormatException e) {
     //Handle exception
}