• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Java Font?

 
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?
 
mister krabs
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..
 
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 ?
 
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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!