FontFamily

Inheritance: java.lang.Object

All Implemented Interfaces: com.aspose.ms.System.IDisposable

public final class FontFamily implements System.IDisposable

Defines a group of type faces having a similar basic design and certain variations in styles. This class cannot be inherited.

Constructors

ConstructorDescription
FontFamily(String name)Initializes a new instance of the FontFamily class with the specified name.
FontFamily(String name, FontCollection fontCollection)Initializes a new instance of the FontFamily class.
FontFamily(String name, FontFamilyDefinition definition)Initializes a new instance of the FontFamily class.

Methods

MethodDescription
getFamilies()Gets an array that contains all the FontFamily objects associated with the current graphics context.
getGenericSansSerif()Gets a generic sans serif FontFamily object.
getGenericSerif()Gets a generic serif FontFamily.
getGenericMonospace()Gets a generic monospace FontFamily.
getName()Gets the name of this FontFamily.
dispose()Releases all resources used by this FontFamily.
getName(int language)Returns the name, in the specified language, of this FontFamily.
isStyleAvailable(int style)Indicates whether the specified FontStyle enumeration is available.
getEmHeight(int style)Gets the height, in font design units, of the EM square for the specified style.
getCellAscent(int style)Returns the cell ascent, in design units, of the FontFamily of the specified style.
getCellDescent(int style)Returns the cell descent, in design units, of the FontFamily of the specified style.
hashCode()Gets a hash code for this FontFamily.
equals(Object obj)Indicates whether the specified object is a FontFamily and is identical to this FontFamily.
getLineSpacing(int style)Returns the line spacing, in design units, of the FontFamily of the specified style.

FontFamily(String name)

public FontFamily(String name)

Initializes a new instance of the FontFamily class with the specified name.

Parameters:

ParameterTypeDescription
namejava.lang.StringThe name of the new FontFamily.

FontFamily(String name, FontCollection fontCollection)

public FontFamily(String name, FontCollection fontCollection)

Initializes a new instance of the FontFamily class.

Parameters:

ParameterTypeDescription
namejava.lang.StringThe name of the font family.
fontCollectionFontCollectionThe font collection.

FontFamily(String name, FontFamilyDefinition definition)

public FontFamily(String name, FontFamilyDefinition definition)

Initializes a new instance of the FontFamily class.

Parameters:

ParameterTypeDescription
namejava.lang.StringThe name of the font family.
definitionFontFamilyDefinitionThe definition.

getFamilies()

public static FontFamily[] getFamilies()

Gets an array that contains all the FontFamily objects associated with the current graphics context.

Returns: com.aspose.drawing.FontFamily[] - An array of FontFamily objects associated with the current graphics context.

getGenericSansSerif()

public static FontFamily getGenericSansSerif()

Gets a generic sans serif FontFamily object.

Returns: FontFamily - A FontFamily object that represents a generic sans serif font.

getGenericSerif()

public static FontFamily getGenericSerif()

Gets a generic serif FontFamily.

Returns: FontFamily - A FontFamily that represents a generic serif font.

getGenericMonospace()

public static FontFamily getGenericMonospace()

Gets a generic monospace FontFamily.

Returns: FontFamily - A FontFamily that represents a generic monospace font.

getName()

public String getName()

Gets the name of this FontFamily.

Returns: java.lang.String - A String that represents the name of this FontFamily.

dispose()

public void dispose()

Releases all resources used by this FontFamily.

getName(int language)

public String getName(int language)

Returns the name, in the specified language, of this FontFamily.

Parameters:

ParameterTypeDescription
languageintThe language in which the name is returned.

Returns: java.lang.String - A String that represents the name, in the specified language, of this FontFamily.

isStyleAvailable(int style)

public boolean isStyleAvailable(int style)

Indicates whether the specified FontStyle enumeration is available.

Parameters:

ParameterTypeDescription
styleintThe FontStyle to test.

Returns: boolean - true if the specified FontStyle is available; otherwise, false.

getEmHeight(int style)

public int getEmHeight(int style)

Gets the height, in font design units, of the EM square for the specified style.

Parameters:

ParameterTypeDescription
styleintThe FontStyle for which to get the EM height.

Returns: int - The height of the EM square.

getCellAscent(int style)

public int getCellAscent(int style)

Returns the cell ascent, in design units, of the FontFamily of the specified style.

Parameters:

ParameterTypeDescription
styleintA FontStyle that contains style information for the font.

Returns: int - The cell ascent for this FontFamily that uses the specified FontStyle.

getCellDescent(int style)

public int getCellDescent(int style)

Returns the cell descent, in design units, of the FontFamily of the specified style.

Parameters:

ParameterTypeDescription
styleintA FontStyle that contains style information for the font.

Returns: int - The cell descent metric for this FontFamily that uses the specified FontStyle.

hashCode()

public int hashCode()

Gets a hash code for this FontFamily.

Returns: int - The hash code for this FontFamily.

equals(Object obj)

public boolean equals(Object obj)

Indicates whether the specified object is a FontFamily and is identical to this FontFamily.

Parameters:

ParameterTypeDescription
objjava.lang.ObjectThe object to test.

Returns: boolean - true if obj is a FontFamily and is identical to this FontFamily; otherwise, false.

getLineSpacing(int style)

public int getLineSpacing(int style)

Returns the line spacing, in design units, of the FontFamily of the specified style. The line spacing is the vertical distance between the base lines of two consecutive lines of text.

Parameters:

ParameterTypeDescription
styleintThe FontStyle to apply.

Returns: int - The distance between two consecutive lines of text.