A
A
Andrey Vershinin2013-12-01 11:43:20
Java
Andrey Vershinin, 2013-12-01 11:43:20

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

1 answer(s)
A
Andrey Vershinin, 2013-12-21
@WolfdalE

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 question

Ask a Question

731 491 924 answers to any question