public final class Font extends Object
Defines a particular format for text, including font face, size, and style attributes. This class cannot be inherited.
Constructor and Description |
---|
Font()
Deprecated.
|
Font(Font prototype,
int newStyle)
Initializes a new
Font that uses the specified existing Font and FontStyle enumeration. |
Font(String fontName,
float emSize)
Initializes a new
Font using a specified size. |
Font(String fontName,
float emSize,
int style)
Initializes a new
Font using a specified size and style. |
Font(String fontName,
float emSize,
int style,
int unit)
Initializes a new
Font using a specified size, style, and unit. |
Font(String fontName,
float emSize,
int style,
int unit,
int characterSet)
Initializes a new
Font using a specified size, style, unit, and character set. |
Modifier and Type | Method and Description |
---|---|
Font |
deepClone()
Creates an exact deep copy of this
Font . |
boolean |
equals(Object obj)
Indicates whether the specified object is a
Font and has the same property values as this 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. |
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 P:Aspose.PSD.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
Font . |
String |
toString()
Returns a human-readable string representation of this
Font . |
@Deprecated public Font()
public Font(Font prototype, int newStyle)
Initializes a new Font
that uses the specified existing Font
and FontStyle
enumeration.
prototype
- The existing Font
from which to create the new Font
.newStyle
- The FontStyle
to apply to the new Font
. Multiple values of the FontStyle
enumeration can be combined with the OR operator.com.aspose.ms.System.ArgumentNullException
- prototype
is null.public Font(String fontName, float emSize)
Initializes a new Font
using a specified size. The character set is set to F:Aspose.PSD.CharacterSet.Default
, the graphics unit to F:Aspose.PSD.GraphicsUnit.Point
, the font style to F:Aspose.PSD.FontStyle.Regular
.
fontName
- A string representation of the Font
name.emSize
- The em-size, in points, of the new font.com.aspose.ms.System.ArgumentOutOfRangeException
- emSize
is less than or equal to 0, evaluates to infinity or is not a valid number.com.aspose.ms.System.ArgumentNullException
- fontName
is null.public Font(String fontName, float emSize, int style)
Initializes a new Font
using a specified size and style. The character set is set to F:Aspose.PSD.CharacterSet.Default
, the graphics unit to F:Aspose.PSD.GraphicsUnit.Point
.
fontName
- A string representation of the Font
name.emSize
- The em-size, in points, of the new font.style
- The FontStyle
of the new font.com.aspose.ms.System.ArgumentOutOfRangeException
- emSize
is less than or equal to 0, evaluates to infinity or is not a valid number.com.aspose.ms.System.ArgumentNullException
- fontName
is null.public Font(String fontName, float emSize, int style, int unit, int characterSet)
Initializes a new Font
using a specified size, style, unit, and character set.
fontName
- A string representation of the Font
name.emSize
- The em-size of the new font in the units specified by the unit
parameter.style
- The FontStyle
of the new font.unit
- The GraphicsUnit
of the new font.characterSet
- A character set to use for this font.com.aspose.ms.System.ArgumentOutOfRangeException
- emSize
is less than or equal to 0, evaluates to infinity or is not a valid number.com.aspose.ms.System.ArgumentNullException
- fontName
is null.public Font(String fontName, float emSize, int style, int unit)
Initializes a new Font
using a specified size, style, and unit.
fontName
- A string representation of the Font
name.emSize
- The em-size of the new font in the units specified by the unit
parameter.style
- The FontStyle
of the new font.unit
- The GraphicsUnit
of the new font.com.aspose.ms.System.ArgumentOutOfRangeException
- emSize
is less than or equal to 0, evaluates to infinity or is not a valid number.com.aspose.ms.System.ArgumentNullException
- fontName
is null.public final boolean getBold()
Gets a value indicating whether this Font
is bold.
Font
is bold; otherwise, false.public final int getCharacterSet()
Gets a byte value that specifies the character set that this Font
uses.
Font
uses.public final boolean getItalic()
Gets a value indicating whether this Font
is italic.
Font
is italic; otherwise, false.public final String getName()
Gets the face name of this Font
.
Font
.public final boolean getStrikeout()
Gets a value indicating whether this Font
specifies a horizontal line through the font.
Font
has a horizontal line through it; otherwise, false.public final boolean getUnderline()
Gets a value indicating whether this Font
is underlined.
Font
is underlined; otherwise, false.public final int getStyle()
Gets style information for this Font
.
FontStyle
enumeration that contains style information for this Font
.public final float getSize()
Gets the em-size of this Font
measured in the units specified by the P:Aspose.PSD.Font.Unit
property.
Font
.public final int getUnit()
Gets the unit of measure for this Font
.
GraphicsUnit
that represents the unit of measure for this Font
.public final Font deepClone()
Creates an exact deep copy of this Font
.
Font
this method creates.public boolean equals(Object obj)
Indicates whether the specified object is a Font
and has the same property values as this Font
.
public int hashCode()
Gets the hash code for this Font
.
Copyright (c) 2008-2019 Aspose Pty Ltd. All Rights Reserved.