Abhishek Choudhary
Abhishek Choudhary

Reputation: 8385

Issue with Font through .ttf file

I Am loading a font through .ttf file in java but the size is coming as 1. How to make it more like 16

InputStream in = Check.class.getResourceAsStream("CALIBRI.TTF");  
Font font = Font.createFont(Font.TRUETYPE_FONT, in); 

Upvotes: 1

Views: 828

Answers (1)

Joachim Sauer
Joachim Sauer

Reputation: 308001

Use Font.deriveFont(Font, float) to derive a font with the desired size from the newly created font.

Upvotes: 2

Related Questions