• Post Reply Bookmark Topic Watch Topic
  • New Topic

using font created by createFont

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?

Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!