• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Font question

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using a font in my program which may not be available to my users. I need to distribute the ttf file for the font along with my application JAR. Can anyone please advice where I need to place the ttf file within my application directory in order to be able to load it from within my program and also distribute it as part of my JAR. (I am using NetBeans 5.5)
Thanks a lot in advance!

I used the following code as suggested in another forum,
URL url = getClass().getResource("ARIALUNI.ttf");
File f = new File(url.toURI());
font=Font.createFont(Font.TRUETYPE_FONT,f);


But this didnt work either...

No idea of how to do it.....
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My guess would be that the font file needs to be installed in whichever directory is appropriate on the client system.
 
This one time, at bandcamp, I had relations with a tiny ad.
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic