📜  使用自定义字体 java 代码示例

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

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