com.aspose.imaging
Class Font

java.lang.Object
  extended by com.aspose.imaging.Font

public final class Font
extends java.lang.Object

Defines a particular format for text, including font face, size, and style attributes. This class cannot be inherited.


Constructor Summary
Font(Font prototype, int newStyle)
           Initializes a new com.aspose.imaging.Font that uses the specified existing com.aspose.imaging.Font and com.aspose.imaging.FontStyle enumeration.
Font(java.lang.String fontName, float emSize)
           Initializes a new com.aspose.imaging.Font using a specified size.
Font(java.lang.String fontName, float emSize, FontStyle style)
           Initializes a new com.aspose.imaging.Font using a specified size and style.
Font(java.lang.String fontName, float emSize, GraphicsUnit unit)
           Initializes a new com.aspose.imaging.Font using a specified size and unit.
Font(java.lang.String fontName, float emSize, int style, int unit)
           Initializes a new com.aspose.imaging.Font using a specified size, style, and unit.
Font(java.lang.String fontName, float emSize, int style, int unit, int characterSet)
           Initializes a new com.aspose.imaging.Font using a specified size, style, unit, and character set.
 
Method Summary
 Font deepClone()
           Creates an exact deep copy of this Font.
 boolean equals(java.lang.Object obj)
           Indicates whether the specified object is a com.aspose.imaging.Font and has the same property values as this com.aspose.imaging.Font.
 boolean getBold()
           Gets a value indicating whether this Font is bold.
 int getCharacterSet()
           Gets a byte value that specifies the character set that this Font uses.
 boolean getItalic()
           Gets a value indicating whether this Font is italic.
 java.lang.String getName()
           Gets the face name of this Font.
 float getSize()
           Gets the em-size of this Font measured in the units specified by the Font.Unit property.
 boolean getStrikeout()
           Gets a value indicating whether this Font specifies a horizontal line through the font.
 int getStyle()
           Gets style information for this Font.
 boolean getUnderline()
           Gets a value indicating whether this Font is underlined.
 int getUnit()
           Gets the unit of measure for this Font.
 int hashCode()
           Gets the hash code for this com.aspose.imaging.Font.
 java.lang.String toString()
           Returns a human-readable string representation of this com.aspose.imaging.Font.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Font

public Font(Font prototype,
            int newStyle)

Initializes a new com.aspose.imaging.Font that uses the specified existing com.aspose.imaging.Font and com.aspose.imaging.FontStyle enumeration.


Font

public Font(java.lang.String fontName,
            float emSize)

Initializes a new com.aspose.imaging.Font using a specified size. The character set is set to com.aspose.imaging.CharacterSet.Default, the graphics unit to com.aspose.imaging.GraphicsUnit.Point, the font style to com.aspose.imaging.FontStyle.Regular.

Parameters:
fontName - A string representation of the com.aspose.imaging.Font name.
emSize - The em-size, in points, of the new font.

Font

public Font(java.lang.String fontName,
            float emSize,
            FontStyle style)

Initializes a new com.aspose.imaging.Font using a specified size and style. The character set is set to com.aspose.imaging.CharacterSet.Default, the graphics unit to com.aspose.imaging.GraphicsUnit.Point.

Parameters:
fontName - A string representation of the com.aspose.imaging.Font name.
emSize - The em-size, in points, of the new font.
style - The com.aspose.imaging.FontStyle of the new font.

Font

public Font(java.lang.String fontName,
            float emSize,
            GraphicsUnit unit)

Initializes a new com.aspose.imaging.Font using a specified size and unit. The character set is set to com.aspose.imaging.CharacterSet.Default, the style is set to com.aspose.imaging.FontStyle.Regular.

Parameters:
fontName - A string representation of the com.aspose.imaging.Font name.
emSize - The em-size of the new font in the units specified by the unit parameter.
unit - The com.aspose.imaging.GraphicsUnit of the new font.

Font

public Font(java.lang.String fontName,
            float emSize,
            int style,
            int unit)

Initializes a new com.aspose.imaging.Font using a specified size, style, and unit.

Parameters:
fontName - A string representation of the com.aspose.imaging.Font name.
emSize - The em-size of the new font in the units specified by the unit parameter.
style - The com.aspose.imaging.FontStyle of the new font.
unit - The com.aspose.imaging.GraphicsUnit of the new font.

Font

public Font(java.lang.String fontName,
            float emSize,
            int style,
            int unit,
            int characterSet)

Initializes a new com.aspose.imaging.Font using a specified size, style, unit, and character set.

Parameters:
fontName - A string representation of the com.aspose.imaging.Font name.
emSize - The em-size of the new font in the units specified by the unit parameter.
style - The com.aspose.imaging.FontStyle of the new font.
unit - The com.aspose.imaging.GraphicsUnit of the new font.
characterSet - A character set to use for this font.
Method Detail

deepClone

public Font deepClone()

Creates an exact deep copy of this Font.

Returns:
The Font this method creates.

equals

public boolean equals(java.lang.Object obj)

Indicates whether the specified object is a com.aspose.imaging.Font and has the same property values as this com.aspose.imaging.Font.

Overrides:
equals in class java.lang.Object
Parameters:
obj - The object to test.
Returns:
True if the obj parameter is a com.aspose.imaging.Font and has the same property values as this com.aspose.imaging.Font; otherwise, false.

getBold

public boolean getBold()

Gets a value indicating whether this Font is bold.

Value: True if this Font is bold; otherwise, false.


getCharacterSet

public int getCharacterSet()

Gets a byte value that specifies the character set that this Font uses.

Value: A character set that this Font uses.


getItalic

public boolean getItalic()

Gets a value indicating whether this Font is italic.

Value: True if this Font is italic; otherwise, false.


getName

public java.lang.String getName()

Gets the face name of this Font.

Value: A string representation of the face name of this Font.


getSize

public float getSize()

Gets the em-size of this Font measured in the units specified by the Font.Unit property.

Value: The em-size of this Font.


getStrikeout

public boolean getStrikeout()

Gets a value indicating whether this Font specifies a horizontal line through the font.

Value: True if this Font has a horizontal line through it; otherwise, false.


getStyle

public int getStyle()

Gets style information for this Font.

Value: A FontStyle enumeration that contains style information for this Font.


getUnderline

public boolean getUnderline()

Gets a value indicating whether this Font is underlined.

Value: True if this Font is underlined; otherwise, false.


getUnit

public int getUnit()

Gets the unit of measure for this Font.

Value: A GraphicsUnit that represents the unit of measure for this Font.


hashCode

public int hashCode()

Gets the hash code for this com.aspose.imaging.Font.

Overrides:
hashCode in class java.lang.Object
Returns:
The hash code for this com.aspose.imaging.Font.

toString

public java.lang.String toString()

Returns a human-readable string representation of this com.aspose.imaging.Font.

Overrides:
toString in class java.lang.Object
Returns:
A string that represents this com.aspose.imaging.Font.