NextApp Echo2
v2.1.0

nextapp.echo2.app
Class Font

java.lang.Object
  extended by nextapp.echo2.app.Font
All Implemented Interfaces:
java.io.Serializable

public class Font
extends java.lang.Object
implements java.io.Serializable

An immutable representation of a text font, including typeface, size, and style.

See Also:
Serialized Form

Nested Class Summary
static class Font.Typeface
          An immutable representation of a type face.
 
Field Summary
static Font.Typeface ARIAL
           
static int BOLD
          A style value indicating bold.
static Font.Typeface COURIER
           
static Font.Typeface COURIER_NEW
           
static Font.Typeface HELVETICA
           
static int ITALIC
          A style value indicating bold.
static int LINE_THROUGH
          A style value indicating line-through.
static Font.Typeface MONOSPACE
           
static int OVERLINE
          A style value indicating overline.
static int PLAIN
          A style value indicating no text attributes.
static Font.Typeface SANS_SERIF
           
static Font.Typeface SERIF
           
static Font.Typeface TIMES
           
static Font.Typeface TIMES_NEW_ROMAN
           
static Font.Typeface TIMES_ROMAN
           
static int UNDERLINE
          A style value indicating underline.
static Font.Typeface VERDANA
           
 
Constructor Summary
Font(Font.Typeface typeface, int style, Extent size)
          Creates a new Font with the specified Typeface, size, and style.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 Extent getSize()
          Returns the size of the font.
 Font.Typeface getTypeface()
          Returns the typeface of the font.
 boolean isBold()
          Determines whether the font is bold.
 boolean isItalic()
          Determines whether the font is italicized.
 boolean isLineThrough()
          Determines whether the font has line-through enabled.
 boolean isOverline()
          Determines whether the font has an overline.
 boolean isPlain()
          Determines whether the font is plain (i.e., the font has no style attributes set).
 boolean isUnderline()
          Determines whether the font is underlined.
 java.lang.String toString()
          Renders a debug representation of the object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SANS_SERIF

public static final Font.Typeface SANS_SERIF

SERIF

public static final Font.Typeface SERIF

MONOSPACE

public static final Font.Typeface MONOSPACE

HELVETICA

public static final Font.Typeface HELVETICA

ARIAL

public static final Font.Typeface ARIAL

VERDANA

public static final Font.Typeface VERDANA

TIMES

public static final Font.Typeface TIMES

TIMES_ROMAN

public static final Font.Typeface TIMES_ROMAN

TIMES_NEW_ROMAN

public static final Font.Typeface TIMES_NEW_ROMAN

COURIER

public static final Font.Typeface COURIER

COURIER_NEW

public static final Font.Typeface COURIER_NEW

PLAIN

public static final int PLAIN
A style value indicating no text attributes.

See Also:
Constant Field Values

BOLD

public static final int BOLD
A style value indicating bold.

See Also:
Constant Field Values

ITALIC

public static final int ITALIC
A style value indicating bold.

See Also:
Constant Field Values

UNDERLINE

public static final int UNDERLINE
A style value indicating underline.

See Also:
Constant Field Values

OVERLINE

public static final int OVERLINE
A style value indicating overline.

See Also:
Constant Field Values

LINE_THROUGH

public static final int LINE_THROUGH
A style value indicating line-through.

See Also:
Constant Field Values
Constructor Detail

Font

public Font(Font.Typeface typeface,
            int style,
            Extent size)
Creates a new Font with the specified Typeface, size, and style.

Parameters:
typeface - a Typeface describing the typeface of the font.
style - the style of the font, one or more of the following values:
  • PLAIN
  • BOLD
  • ITALIC
  • OVERLINE
  • LINE_THROUGH
  • UNDERLINE
If it is necessary create a font with multiple style attributes, they should be bitwise-ORed together, using an expression such as BOLD | UNDERLINE.
size - the size of the font as a Extent
Method Detail

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

getSize

public Extent getSize()
Returns the size of the font.

Returns:
the size of the font

getTypeface

public Font.Typeface getTypeface()
Returns the typeface of the font.

Returns:
the typeface of the font

isBold

public boolean isBold()
Determines whether the font is bold.

Returns:
true if the font is bold

isItalic

public boolean isItalic()
Determines whether the font is italicized.

Returns:
true if the font is italicized

isLineThrough

public boolean isLineThrough()
Determines whether the font has line-through enabled.

Returns:
true if the font has line-through enabled

isPlain

public boolean isPlain()
Determines whether the font is plain (i.e., the font has no style attributes set).

Returns:
true if the font is plain

isOverline

public boolean isOverline()
Determines whether the font has an overline.

Returns:
true if the font has an overline

isUnderline

public boolean isUnderline()
Determines whether the font is underlined.

Returns:
true if the font is underlined

toString

public java.lang.String toString()
Renders a debug representation of the object.

Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

NextApp Echo2
v2.1.0