Hi, I’m trying to import a true type font (.ttf) into my Java game. I found a method of doing this on the internet but when I load the font and then display some text using it the text is really small, or maybe it’s not displaying right it’s kind of hard to tell. I also tried deriving a new font from the original with a different size but that didn’t work (using font.deriveFont(Float size)). Anyway this is where I got my method from http://www.java2s.com/Code/Java/2D-Graphics-GUI/Loadfontfromttffile.htm and this is the important part of the code:
try {
InputStream is = DemoFonts.class.getResourceAsStream(fName);
font = Font.createFont(Font.TRUETYPE_FONT, is);
} catch (Exception ex) {
ex.printStackTrace();
System.err.println(fName + " not loaded. Using serif font.");
font = new Font("serif", Font.PLAIN, 24);
}


