Home  Products  Purchase  Downloads  Demos  Forums  Blogs  Ticket  Wiki  API  Corporate

com.aspose.cells
Class Font

java.lang.Object
  extended by com.aspose.cells.Font
All Implemented Interfaces:
java.lang.Cloneable

public final class Font
extends java.lang.Object
implements java.lang.Cloneable

Represents a font used in a spreadsheet.


Field Summary
static int ESCAPEMENT_NONE
          Represents no escapement.
static int ESCAPEMENT_SUBSCRIPT
          Represents subscript escapement.
static int ESCAPEMENT_SUPERSCRIPT
          Represents superscript escapement.
static int FAMILY_DECORATIVE
          Represents the decorative font faminly.
static int FAMILY_MODERN
          Represents the modern font family.
static int FAMILY_NONE
          Represents no font family is specified.
static int FAMILY_ROMAN
          Represents the roman font family.
static int FAMILY_SCRIPT
          Represents the script font family.
static int FAMILY_SWISS
          Represents the swiss font family.
static int UNDERLINE_DOUBLE
          Represents double underline.
static int UNDERLINE_DOUBLE_ACCOUNTING
          Represents double accounting underline.
static int UNDERLINE_NONE
          Represents no underline.
static int UNDERLINE_SINGLE
          Represents single underline.
static int UNDERLINE_SINGLE_ACCOUNTING
          Represents single accounting underline.
 
Constructor Summary
Font()
          Initializes a new instance of the Font class.
Font(Font font)
          Initializes a new instance of the Font class that copies the specified font.
 
Method Summary
 java.lang.Object clone()
          Creates and returns a copy of this object.
 boolean equals(java.lang.Object obj)
          Indicates whether some other object is "equal to" this one.
 Color getColor()
          Gets the font color.
 int getEscapement()
          Gets the escapement type.
 int getFamily()
          Gets the font family.
 java.lang.String getName()
          Gets the font name.
 int getSize()
          Gets the font size in points.
 int getUnderline()
          Gets the underline type.
 int hashCode()
          Returns a hash code value for the object.
 boolean isBold()
          Checks if the font is bold.
 boolean isItalic()
          Checks if the font is italic.
 boolean isStruckOut()
          Checks if the strikeout horizontal line is used.
 void setBold(boolean bold)
          Sets the font whether to be bold or not.
 void setColor(Color color)
          Sets the font color.
 void setEscapement(int escapement)
          Sets the escapement type.
protected  void setFamily(int family)
           
 void setItalic(boolean italic)
          Sets whether the font to be italic or not.
 void setName(java.lang.String name)
          Sets the font name.
 void setSize(int size)
          Sets the font size.
 void setStrikeOut(boolean strikeOut)
          Sets the strikeout horizontal line to be used or not.
 void setUnderline(int underline)
          Sets the underline type.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ESCAPEMENT_NONE

public static final int ESCAPEMENT_NONE
Represents no escapement. It is the default value.

See Also:
Constant Field Values

ESCAPEMENT_SUPERSCRIPT

public static final int ESCAPEMENT_SUPERSCRIPT
Represents superscript escapement.

See Also:
Constant Field Values

ESCAPEMENT_SUBSCRIPT

public static final int ESCAPEMENT_SUBSCRIPT
Represents subscript escapement.

See Also:
Constant Field Values

UNDERLINE_NONE

public static final int UNDERLINE_NONE
Represents no underline. It is the default value.

See Also:
Constant Field Values

UNDERLINE_SINGLE

public static final int UNDERLINE_SINGLE
Represents single underline.

See Also:
Constant Field Values

UNDERLINE_DOUBLE

public static final int UNDERLINE_DOUBLE
Represents double underline.

See Also:
Constant Field Values

UNDERLINE_SINGLE_ACCOUNTING

public static final int UNDERLINE_SINGLE_ACCOUNTING
Represents single accounting underline.

See Also:
Constant Field Values

UNDERLINE_DOUBLE_ACCOUNTING

public static final int UNDERLINE_DOUBLE_ACCOUNTING
Represents double accounting underline.

See Also:
Constant Field Values

FAMILY_NONE

public static final int FAMILY_NONE
Represents no font family is specified. It is the default value.

See Also:
Constant Field Values

FAMILY_ROMAN

public static final int FAMILY_ROMAN
Represents the roman font family.

See Also:
Constant Field Values

FAMILY_SWISS

public static final int FAMILY_SWISS
Represents the swiss font family.

See Also:
Constant Field Values

FAMILY_MODERN

public static final int FAMILY_MODERN
Represents the modern font family.

See Also:
Constant Field Values

FAMILY_SCRIPT

public static final int FAMILY_SCRIPT
Represents the script font family.

See Also:
Constant Field Values

FAMILY_DECORATIVE

public static final int FAMILY_DECORATIVE
Represents the decorative font faminly.

See Also:
Constant Field Values
Constructor Detail

Font

public Font()
Initializes a new instance of the Font class.


Font

public Font(Font font)
Initializes a new instance of the Font class that copies the specified font.

Parameters:
font - the font reference to copy from.
Throws:
java.lang.IllegalArgumentException - if the font parameter is null.
Method Detail

clone

public java.lang.Object clone()
Creates and returns a copy of this object.

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

equals

public boolean equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one.

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

hashCode

public int hashCode()
Returns a hash code value for the object.

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

isBold

public boolean isBold()
Checks if the font is bold.

Returns:
true if the font is bold.

isItalic

public boolean isItalic()
Checks if the font is italic.

Returns:
true if the font is italic.

isStruckOut

public final boolean isStruckOut()
Checks if the strikeout horizontal line is used.

Returns:
true if the strikeout horizontal line is used.

getColor

public final Color getColor()
Gets the font color.

Returns:
the font color.

getEscapement

public final int getEscapement()
Gets the escapement type.

Returns:
the escapement type. It could be one of the following values:
Font.ESCAPEMENT_NONE
Font.ESCAPEMENT_SUPERSCRIPT
Font.ESCAPEMENT_SUBSCRIPT

getFamily

public final int getFamily()
Gets the font family.

Returns:
the font family. It could be one of the following values:
Font.FAMILY_NONE
Font.FAMILY_ROMAN
Font.FAMILY_SWISS
Font.FAMILY_MODERN
Font.FAMILY_SCRIPT
Font.FAMILY_DECORATIVE

getName

public final java.lang.String getName()
Gets the font name.

Returns:
the font name.

getSize

public final int getSize()
Gets the font size in points.

Returns:
the font size. In points.

getUnderline

public final int getUnderline()
Gets the underline type.

Returns:
the underline type. It could be one of the following values:
Font.UNDERLINE_NONE
Font.UNDERLINE_SINGLE
Font.UNDERLINE_DOUBLE
Font.UNDERLINE_SINGLE_ACCOUNTING
Font.UNDERLINE_DOUBLE_ACCOUNTING

setBold

public final void setBold(boolean bold)
Sets the font whether to be bold or not.

Parameters:
bold - true for bold.

setColor

public void setColor(Color color)
Sets the font color.

Parameters:
color - the font color.

setEscapement

public void setEscapement(int escapement)
Sets the escapement type.

Parameters:
escapement - the escapement type. It could be one of the following values:
Font.ESCAPEMENT_NONE
Font.ESCAPEMENT_SUPERSCRIPT
Font.ESCAPEMENT_SUBSCRIPT

setItalic

public void setItalic(boolean italic)
Sets whether the font to be italic or not.

Parameters:
italic - true for italic.

setName

public void setName(java.lang.String name)
Sets the font name.

Parameters:
name - name of the font.
Throws:
java.lang.IllegalArgumentException - if the name is null or empty.

setSize

public void setSize(int size)
Sets the font size.

Parameters:
size - font size(1-409).
Throws:
java.lang.IllegalArgumentException - if the font size is invalid.

setStrikeOut

public void setStrikeOut(boolean strikeOut)
Sets the strikeout horizontal line to be used or not.

Parameters:
strikeOut - true to use the strikeout horizontal line.

setUnderline

public void setUnderline(int underline)
Sets the underline type.

Parameters:
underline - the underline type. It could be one of the following values:
Font.UNDERLINE_NONE
Font.UNDERLINE_SINGLE
Font.UNDERLINE_DOUBLE
Font.UNDERLINE_SINGLE_ACCOUNTING
Font.UNDERLINE_DOUBLE_ACCOUNTING

setFamily

protected void setFamily(int family)