com.denova.ui
Class Fonts

java.lang.Object
  |
  +--com.denova.ui.Fonts

public class Fonts
extends java.lang.Object

Common fonts. Too many fonts spoil the look of an application. This class provides a standard font set. It also includes a locale-safe setFont(). For great fonts, you have to turn on anti-aliasing. By default it's off in Sun java 5 and 6. One option is to add this to your main() method, before doing anything at all with Swing:

            // set anti-aliasing
            System.getProperties().setProperty("swing.aatext", "true");
    
Another option is to set the "swing.aatext" property on the java command line by adding:
            -Dswing.aatext=true
    
This class also sets swing.aatext=true in a static initializer, but there's no guarantee that this static code will run before any Swing code. Copyright 2008 DeNova All rights reserved worldwide
Last modified: 2008.04.04


Field Summary
static java.awt.Font Big
          Standard big font.
static float BigPointSize
          The BigPointSize is larger than the Dialog point size.
static java.awt.Font Bold
          Standard bold font.
static java.awt.Font Dialog
          The Dialog font is the default font for a JComponent on the current platform.
static java.awt.Font Header
          Standard header font; bigger than Big.
static float HeaderPointSize
          The HeaderPointSize is much larger the Dialog point size.
static java.awt.Font Italic
          Standard italic font.
static java.awt.Font Plain
          Standard plain font.
static float PointSize
          The default PointSize is the size of the Dialog font.
static java.awt.Font Small
           
static float SmallPointSize
          The SmallPointSize is smaller than the Dialog point size.
 
Constructor Summary
Fonts()
           
 
Method Summary
static void setFont(javax.swing.JComponent component, java.awt.Font font)
          Set the font for a JComponent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Dialog

public static java.awt.Font Dialog
The Dialog font is the default font for a JComponent on the current platform.


PointSize

public static float PointSize
The default PointSize is the size of the Dialog font.


Plain

public static java.awt.Font Plain
Standard plain font. The point size is the size of the Dialog font.


Bold

public static java.awt.Font Bold
Standard bold font.


Italic

public static java.awt.Font Italic
Standard italic font.


SmallPointSize

public static float SmallPointSize
The SmallPointSize is smaller than the Dialog point size.


Small

public static java.awt.Font Small

BigPointSize

public static float BigPointSize
The BigPointSize is larger than the Dialog point size.


Big

public static java.awt.Font Big
Standard big font.


HeaderPointSize

public static float HeaderPointSize
The HeaderPointSize is much larger the Dialog point size. Use the Header font where you would use a header in html.


Header

public static java.awt.Font Header
Standard header font; bigger than Big.

Constructor Detail

Fonts

public Fonts()
Method Detail

setFont

public static void setFont(javax.swing.JComponent component,
                           java.awt.Font font)
Set the font for a JComponent. Non-latin fonts often can't handle variants such as Font.BOLD. If the locale's default langauge is non-Latin, then don't change the font.

Parameters:
component - where to set the font
font - new font