EchoPoint API - 3.0.0b5
App Webcontainer

echopoint.style
Class DefaultFont

java.lang.Object
  extended by echopoint.style.DefaultFont

public class DefaultFont
extends Object

A font utility class that is used to enforce an application wide font face policy. The default font face, font style and font size to use may be specified as system properties with the following keys:

Alternatively, the default font properties may be specified in your web.xml file as servlet init-param values if extending from the echopoint.Servlet class (in the webcontainer tree).

Note: Please note that the fonts are created using FontKit.makeFont(String), so please follow the same conventions when configuring the font properties.

Version:
$Id: DefaultFont.java 208 2009-05-25 02:40:35Z sptrakesh $
Author:
Rakesh 2009-05-13

Field Summary
static String SIZE_KEY
          The system property used to configure the default font size.
static String SIZE_VALUE
          The default font size used if the property is not configured.
static String STYLE_KEY
          The system property used to configure the default font style.
static String STYLE_VALUE
          The default font style to use for the application if not configured.
static String TYPEFACE_KEY
          The system property used to configure the font typeface.
static String TYPEFACE_VALUE
          The default font face to use if the typeface system property is not set.
 
Method Summary
static Font fontWithSize(String size)
          Return the default font (typeface and style) for the application with the specified size.
static Font fontWithStyle(String style)
          Return the standard font (typeface and size) with the specified style.
static Font getInstance()
          Return the default font for the application.
static Font getInstance(String style, String size)
           
static void setSize(String size)
          Set the default size to use.
static void setStyle(String style)
          Set the default style to use.
static void setTypeFace(String typeface)
          Set the default typeface to use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPEFACE_KEY

public static final String TYPEFACE_KEY
The system property used to configure the font typeface.


TYPEFACE_VALUE

public static final String TYPEFACE_VALUE
The default font face to use if the typeface system property is not set. "\'Verdana, Times New Roman, Lucida Grande\'"

See Also:
Constant Field Values

STYLE_KEY

public static final String STYLE_KEY
The system property used to configure the default font style.


STYLE_VALUE

public static final String STYLE_VALUE
The default font style to use for the application if not configured. "PLAIN"

See Also:
Constant Field Values

SIZE_KEY

public static final String SIZE_KEY
The system property used to configure the default font size.


SIZE_VALUE

public static final String SIZE_VALUE
The default font size used if the property is not configured. "10pt"

See Also:
Constant Field Values
Method Detail

getInstance

public static Font getInstance()
Return the default font for the application.

Returns:
The default font to use for the application.

getInstance

public static Font getInstance(String style,
                               String size)

fontWithSize

public static Font fontWithSize(String size)
Return the default font (typeface and style) for the application with the specified size.

Parameters:
size - The size for the requested font.
Returns:
The standard font of requested size.

fontWithStyle

public static Font fontWithStyle(String style)
Return the standard font (typeface and size) with the specified style.

Parameters:
style - The style to use for the font.
Returns:
The standard font with the specified style.

setTypeFace

public static void setTypeFace(String typeface)
Set the default typeface to use. Note that this method will need to be invoked before the stylesheet is loaded.

Parameters:
typeface - The typeface to use as default.
See Also:
FontKit.makeFont(String)

setStyle

public static void setStyle(String style)
Set the default style to use. Note that this method will need to be invoked before the stylesheet is loaded.

Parameters:
style - The style to use as default.
See Also:
FontKit.makeFont(String)

setSize

public static void setSize(String size)
Set the default size to use. Note that this method will need to be invoked before the stylesheet is loaded.

Parameters:
size - The size to use as default.
See Also:
FontKit.makeFont(String)

EchoPoint API - 3.0.0b5
App Webcontainer