• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How do I include a custom font in a NetBean project?

 
Greenhorn
Posts: 27
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So, here is the situation, I have a project in NetBeans and I want to include a custom font used by the application.

How would I include this font in the jar so that it was included automatically on the client system?

Thanks!
 
Daniel Gallant
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
After a little more Google-Foo, I have found the answer:

http://java.sun.com/j2se/1.3/docs/guide/intl/addingfonts.html

In a nutshell:

Physical font files can be installed in either an operating system's standard location for fonts or in the jre/lib/fonts library of the Java 2 SDK (or in the lib/fonts directory of the Java 2 Runtime Environment). Fonts in either the operating system's standard location or in the lib/font directory will be on the Java runtime's "font path" and can be used by applications and applets.

So, to get this, I need to use FontPath (http://www.davisor.com/offisor-docs/api/com/davisor/font/FontPath.html).

I hope this helps others.
 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well done, sorting it out.
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Note that your link points to the documentation of an old version of Java (1.3), the same docs for Java 6 can be found here:
http://java.sun.com/javase/6/docs/technotes/guides/intl/font.html (part of the docs about internationalization support)

(although I think that not much has changed with regard to this subject).
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic