Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

using font created by createFont  RSS feed

Sameer Shinde
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have created a font using a TTF font file as follows:

FileInputStream fis = new FileInputStream("font.ttf"]);
f = Font.createFont(Font.TRUETYPE_�FONT, fis);

If I create instance of this font and apply this to a textfield using
setFont method,the displayed text in the text field is too small that
we cant see it.
If we apply the method deriveFont(int size) to font before passing it
to setFont and giving a large value of size, it won't work and we can't
see it.
How to overcome this problem? Any suggestions?

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!