Answers for "use font java"

2

how to load font in java

try {
  
    Font font = Font.createFont(Font.TRUETYPE_FONT,
                                new File("./Fonts/AyyBoyyy.ttf"));
    Font bold = font.deriveFont(Font.BOLD, 12);
	Font plain = font.deriveFont(Font.PLAIN, 12);
  
} catch (FontFormatException | IOException e) {
  e.printStackTrace();
}
Posted by: Guest on August-03-2021
3

Howow to use font object Java

Font smallFont = new Font("Monospaced", Font.PLAIN, 10);  
Font bigFont = new Font("Serif", Font.BOLD, 18);
Posted by: Guest on October-28-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language