1try {
2
3 Font font = Font.createFont(Font.TRUETYPE_FONT,
4 new File("./Fonts/AyyBoyyy.ttf"));
5 Font bold = font.deriveFont(Font.BOLD, 12);
6 Font plain = font.deriveFont(Font.PLAIN, 12);
7
8} catch (FontFormatException | IOException e) {
9 e.printStackTrace();
10}
1try {
2 GraphicsEnvironment ge =
3 GraphicsEnvironment.getLocalGraphicsEnvironment();
4 ge.registerFont(Font.createFont(Font.TRUETYPE_FONT, new File("A.ttf")));
5} catch (IOException|FontFormatException e) {
6 //Handle exception
7}
8