including fonts in Java : Java Glossary

*0-9ABCDEFGHIJKLMNOPQRSTUVWXYZ (all)

including fonts in Java

Java AWT (Advanced Windowing Toolkit) apps can access five basic logical fonts. Java Swing apps can access any fonts already installed. You can use web fonts in your web apps but how do you include special fonts with your desktop apps or Applets?

  1. Check your font licence to make sure you are allowed to bundle them into your app. Usually free fonts permit you to and pay fonts do not without paying an extra fee.
  2. Bundle the font, usually OpenType format, into the distributable jar as a resource.
  3. Load the resource with getResourceAsStream.
  4. Use Font.createFont to convert the resource to a 1-point Font.
  5. Use Font.deriveFont to convert that tiny Font to the pointsize you need.
font
Fontspring: flat rates for fonts for desktop, web, ebooks, apps
Google free webfonts: work in your website
logical fonts
web fonts


This page is posted
on the web at:

http://mindprod.com/jgloss/includedfonts.html

Optional Replicator mirror
of mindprod.com
on local hard disk J:

J:\mindprod\jgloss\includedfonts.html
Canadian Mind Products
Please the feedback from other visitors, or your own feedback about the site.
Contact Roedy. Please feel free to link to this page without explicit permission.

IP:[65.110.21.43]
Your face IP:[3.147.62.5]
You are visitor number