aspose file tools*
The moose likes Beginning Java and the fly likes How do I include a custom font in a NetBean project? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How do I include a custom font in a NetBean project?" Watch "How do I include a custom font in a NetBean project?" New topic
Author

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

Daniel Gallant
Greenhorn

Joined: Sep 09, 2009
Posts: 27
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

Joined: Sep 09, 2009
Posts: 27
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.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36499
    
  16
Well done, sorting it out.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 13875
    
  10

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).


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How do I include a custom font in a NetBean project?
 
Similar Threads
good reference for java web service
Static Import in Java 5
Call font in CSS and the font will be in project font folder
SONAR-Open Source Tool-Need Help
Setting custom font JOptionPane