Font Class

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

Module: aspose.psd

Full Name: aspose.psd.Font

Aspose.PSD Version: 24.9.0

Constructors

NameDescription
Font(font_name, em_size)Initializes a new Font using a specified size. The character set is set to CharacterSet.DEFAULT, the graphics unit to GraphicsUnit.POINT, the font style to FontStyle.REGULAR.
Font(font_name, em_size, style)Initializes a new Font using a specified size and style. The character set is set to CharacterSet.DEFAULT, the graphics unit to GraphicsUnit.POINT.
Font(font_name, em_size, style, unit)Initializes a new Font using a specified size, style, and unit.
Font(font_name, em_size, style, unit, character_set)Initializes a new Font using a specified size, style, unit, and character set.
Font(font_name, em_size, unit)Initializes a new Font using a specified size and unit. The character set is set to CharacterSet.DEFAULT, the style is set to FontStyle.REGULAR.
Font(prototype, new_style)Initializes a new Font that uses the specified existing Font and FontStyle enumeration.

Properties

NameTypeAccessDescription
boldboolrGets a value indicating whether this Font is bold.
character_setCharacterSetrGets a byte value that specifies the character set that this Font uses.
italicboolrGets a value indicating whether this Font is italic.
namestringrGets the face name of this Font.
sizefloatrGets the em-size of this Font measured in the units specified by the Font.unit property.
strikeoutboolrGets a value indicating whether this Font specifies a horizontal line through the font.
styleFontStylerGets style information for this Font.
underlineboolrGets a value indicating whether this Font is underlined.
unitGraphicsUnitrGets the unit of measure for this Font.

Methods

NameDescription
deep_clone()Creates an exact deep copy of this Font.

Constructor: Font(font_name, em_size)

 Font(font_name, em_size) 

Initializes a new Font using a specified size. The character set is set to CharacterSet.DEFAULT, the graphics unit to GraphicsUnit.POINT, the font style to FontStyle.REGULAR.

Parameters:

ParameterTypeDescription
font_namestringA string representation of the Font name.
em_sizefloatThe em-size, in points, of the new font.

Constructor: Font(font_name, em_size, style)

 Font(font_name, em_size, style) 

Initializes a new Font using a specified size and style. The character set is set to CharacterSet.DEFAULT, the graphics unit to GraphicsUnit.POINT.

Parameters:

ParameterTypeDescription
font_namestringA string representation of the Font name.
em_sizefloatThe em-size, in points, of the new font.
styleFontStyleThe FontStyle of the new font.

Constructor: Font(font_name, em_size, style, unit)

 Font(font_name, em_size, style, unit) 

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

Parameters:

ParameterTypeDescription
font_namestringA string representation of the Font name.
em_sizefloatThe em-size of the new font in the units specified by the parameter.
styleFontStyleThe FontStyle of the new font.
unitGraphicsUnitThe GraphicsUnit of the new font.

Constructor: Font(font_name, em_size, style, unit, character_set)

 Font(font_name, em_size, style, unit, character_set) 

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

Parameters:

ParameterTypeDescription
font_namestringA string representation of the Font name.
em_sizefloatThe em-size of the new font in the units specified by the parameter.
styleFontStyleThe FontStyle of the new font.
unitGraphicsUnitThe GraphicsUnit of the new font.
character_setCharacterSetA character set to use for this font.

Constructor: Font(font_name, em_size, unit)

 Font(font_name, em_size, unit) 

Initializes a new Font using a specified size and unit. The character set is set to CharacterSet.DEFAULT, the style is set to FontStyle.REGULAR.

Parameters:

ParameterTypeDescription
font_namestringA string representation of the Font name.
em_sizefloatThe em-size of the new font in the units specified by the parameter.
unitGraphicsUnitThe GraphicsUnit of the new font.

Constructor: Font(prototype, new_style)

 Font(prototype, new_style) 

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

Parameters:

ParameterTypeDescription
prototypeFontThe existing Font from which to create the new Font.
new_styleFontStyleThe FontStyle to apply to the new Font. Multiple values of the FontStyle enumeration can be combined with the OR operator.

Method: deep_clone()

 deep_clone() 

Creates an exact deep copy of this Font.

Returns

TypeDescription
FontThe Font this method creates.