Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Java Font?  RSS feed

 
ali rafiq
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI
My language is urdu..and i have its font file urdu.ttf then how could i use it on my textarea or editor..??
if u send me the code then i can understand very well bcoz my english is not good ..
or any web site link to get the hint?
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The TextArea supports UniCode so you can just specify the UniCode characters in your code in order to write to it.
 
ali rafiq
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but how could i call the file of font
at the way like that
i found to use .. how to use fonthere
but i didnt find the simple to use my own ttf..
 
Raza raz
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I m not sure ali about if this is the solution to your problem
You can use arabic fonts here
the site u already know
http://www.unicode.org/charts/
Let me know if this is :
regards
Raza
 
ali rafiq
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes ihave told u that . i have get the Unicode.. of my langauge .. but the problem is that .. in which component i use it . im i use it TextArea .. or TextEditor?? and any another ?
 
Steffen Kux
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ali,
You can use true type fonts like this:
InputStream is=new FileInputStream("your_font.ttf");
Font font=Font.createFont(Font.TRUETYPE_FONT,is);
is.close();
This works, I think, since java 1.3. The problem is, that java is creating a temporary file each time you create such an instance and is NOT deleteing it!! So you are collecting a lot of space in your temp directory.
Hope it helps.
Steffen
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!