Answer the question
In order to leave comments, you need to log in
Why doesn't a custom TrueType font fit in JTextField height?
The problem is described in the title.
Writing:
Font mainFont = createFont(Font.TRUETYPE_FONT, new File("res/my_font.ttf"));
JTextField textField = new JTextField("sample text");
textField.setFont(mainFont.deriveFont(32.0f);
Answer the question
In order to leave comments, you need to log in
In general, the solution was this:
1. Convert to OTF
2. Use as Type1 font
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question