Partager via


GDI Plus FontFamily Foundation Class

The gpFontFamily class designates attributes shared by a group of related fonts.

Category

Reporting

Default Catalog

Visual FoxPro Catalog\Foundation Classes\Output\GDIplus

Class

gpFontFamily

Base Class

Custom

Class Library

_GDIPLUS.vcx

Parent Class

gpObject (GDI Plus Object Foundation Class)

Remarks

The following table lists public properties and methods added by this class to its parent class, gpObject. It also implements the Clone and Init methods.

Values listed as em height in the table are equivalent to cell ascent (height of the font above the line) + cell descent (height of the font below the line) - internal leading of the font. Values listed as line spacing are equal to cell ascent + cell descent + external leading.

Properties and methods

Description

Clone Method

Clones a font family object.

Syntax: ? THIS.Clone(toFontFamily)

Return Values: Logical, representing success or failure.

Parameters: 

toFontFamily, required, the gpFontFamily object to clone.

Create Method

Creates a font family object from a specified name.

Syntax: ? THIS.Create(tcName)

Return Values: Logical, representing success or failure.

Parameters: 

tcName, required, the name of the font family.

FontName Property

Font family name, such as "Arial."

Default: Empty.

gdipFontCollectionHandle Property

Handle to GDI+ FontCollection object.

Default: 0.

Remarks: This class does not manage this handle at all, it merely uses it.

GetCellAscent Method

Provides cell ascent in design units of this font family in the specified style.

Syntax: nAscent =THIS.GetCellAscent([tnStyle])

Return Values: Number. Returns null (.NULL.) on failure.

Parameters: 

tnStyle, optional, font style as specified in GDIPLUS_FontStyle_* constants. Default value is GDIPLUS_FontStyle_Regular.

GetCellDescent Method

Provides cell descent in design units of this font family in the specified style.

Syntax: nDescent =THIS.GetCellDescent([tnStyle])

Return Values: Number. Returns null (.NULL.) on failure.

Parameters: 

tnStyle, optional, font style as specified in GDIPLUS_FontStyle_* constants. Default value is GDIPLUS_FontStyle_Regular.

GetEmHeight Method

Provides em height in design units of this font family in the specified style.

Syntax: nHeight =THIS.GetEmHeight([tnStyle])

Return Values: Number. Returns null (.NULL.) on failure.

Parameters: 

tnStyle, optional, font style as specified in GDIPLUS_FontStyle_* constants. Default value is GDIPLUS_FontStyle_Regular.

GetGenericMonospace Method

Provides a generic monospace font family object.

Syntax: THIS.GetGenericMonospace()

Return Values: Logical, representing success or failure.

Parameters:  None.

Remarks: Upon successful return from this method, the object represents a system standard font family, and all properties become read-only.

GetGenericSansSerif Method

Provides a generic sans serif font family object.

Syntax: THIS.GetGenericSansSerif()

Return Values: Logical, representing success or failure.

Parameters:  None.

Remarks: Upon successful return from this method, the object represents a system standard font family, and all properties become read-only.

GetGenericSerif Method

Provides a generic serif font family object.

Syntax: THIS.GetGenericSerif()

Return Values: Logical, representing success or failure.

Parameters:  None.

Remarks: Upon successful return from this method, the object represents a system standard font family, and all properties become read-only.

GetLineSpacing Method

Provides line spacing in design units of this font family in the specified style.

Syntax: nHeight =THIS.GetEmHeight([tnStyle])

Return Values: Number. Returns null (.NULL.) on failure.

Parameters: 

tnStyle, optional, font style as specified in GDIPLUS_FontStyle_* constants. Default value is GDIPLUS_FontStyle_Regular.

GetName Method

Provides the name of this font family in the specified language.

Syntax: cName =THIS.GetName([tnLanguageID])

Return Values: String. Returns null (.NULL.) on failure.

Parameters: 

tnLanguage, optional, Language Identifier. Default value is 0.

Init Method

Constructs a font family object during initialization if passed appropriate arguments.

Syntax: CREATEOBJECT("gpFontFamily", tcFontFamilyName)

Return Values: Logical, representing success or failure. If the method fails, the object does not instantiate.

Parameters: 

tcFontFamilyName, required if immediate creation of the object is requested. A string representing the name of a font family.

IsStyleAvailable Method

Tests whether a requested font style can be natively provided in this font family.

Syntax: ? THIS.IsStyleAvailable(tnStyle)

Return Values: Logical.

Parameters: 

tnStyle, required, font style as specified in GDIPLUS_FontStyle_* constants. Default value is GDIPLUS_FontStyle_Regular.

Remarks: Although technically correct, a False (.F.) return value from this function can be misleading. Windows can usually synthesize font styles when the specific style for a font is not available.

See Also

Concepts

Guidelines for Using Visual FoxPro Foundation Classes

Reference

Visual FoxPro Foundation Classes A-Z

GDI Plus API Wrapper Foundation Classes