ice.pilots.html4
Class JavaFontProvider

java.lang.Object
  extended byice.pilots.html4.JavaFontProvider
All Implemented Interfaces:
FontProvider
Direct Known Subclasses:
FractionalDeviceFontProvider

public class JavaFontProvider
extends Object
implements FontProvider

This class implements the FontProvider interface for the Java runtime. This allows the FontCache to treat all Font sources as instances of FontProvider, and allows a great deal of clean up of that code.


Field Summary
protected  String[] allFamilies
           
protected  Hashtable familyHash
           
protected  String[] genericToJava
           
 
Fields inherited from interface ice.pilots.html4.FontProvider
JAVA_VM
 
Constructor Summary
JavaFontProvider()
          Constructor for the JavaFontProvider instance.
 
Method Summary
 Font getFont(String fontFamily, int fontStyle, int fontSize)
          Load a Font instance.
 String[] getFontFamilies()
          Retrieve an array of all Font families available from this FontProvider.
 FontMetrics getFontMetrics(Font font)
          Retrieve the FontMetrics object for the given Font.
protected  void init()
          Initialize the Font provider.
protected  void initJava1Fonts()
          Initialize the Fonts using the Java 118 method
protected  boolean initJava2Fonts()
          Try to init the Font system using Version >= 1.2 methods
 boolean isFamilySupported(String fontFamily)
          Determine if this Font provider supports a given font family.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

genericToJava

protected String[] genericToJava

allFamilies

protected String[] allFamilies

familyHash

protected Hashtable familyHash
Constructor Detail

JavaFontProvider

public JavaFontProvider()
Constructor for the JavaFontProvider instance.

Method Detail

isFamilySupported

public boolean isFamilySupported(String fontFamily)
Determine if this Font provider supports a given font family.

Specified by:
isFamilySupported in interface FontProvider
Parameters:
fontFamily - The font family name
Returns:
true if the Font family is in the list of supported Fonts

getFontFamilies

public String[] getFontFamilies()
Retrieve an array of all Font families available from this FontProvider.

Specified by:
getFontFamilies in interface FontProvider
Returns:
An array of Font Family names

getFont

public Font getFont(String fontFamily,
                    int fontStyle,
                    int fontSize)
Load a Font instance. This method should not be called without some form of Font caching front end.

Specified by:
getFont in interface FontProvider
Parameters:
fontFamily - The Font family
fontStyle - The Font style, equivalent to the awt.Font enumeration
fontSize - The size of the Font in points.
Returns:
the Font object

init

protected void init()
Initialize the Font provider.


initJava1Fonts

protected void initJava1Fonts()
Initialize the Fonts using the Java 118 method


initJava2Fonts

protected boolean initJava2Fonts()
Try to init the Font system using Version >= 1.2 methods

Returns:

getFontMetrics

public FontMetrics getFontMetrics(Font font)
Description copied from interface: FontProvider
Retrieve the FontMetrics object for the given Font. On some platforms, the original method of getting the FontMetrics information doesn't work in Headless mode. There are solutions, but they all entail specialized techniques to > Java1.2. This method allows the FontProvider to perform the work, which allows for the creation of specific instances that can take advantage of the environment

Specified by:
getFontMetrics in interface FontProvider
Parameters:
font -
Returns: