Home COM GDI+ WebBrowser Data Access 

FontFamily Functions (GDI+)

 

 

A font family is a group of fonts that have the same typeface but different styles.

 

Return Values

If the function succeeds, it returns Ok, which is an element of the Status enumeration.

 

If the function fails, it returns one of the other elements of the Status enumeration.

 

GdipCloneFontFamily

 

Description

Creates a new FontFamily object based on this FontFamily object.

Syntax

GpStatus WINGDIPAPI GdipCloneFontFamily(

    GpFontFamily *FontFamily,

    GpFontFamily **clonedFontFamily

);

PowerBASIC Syntax

DECLARE FUNCTION GdipCloneFontFamily ( _

    BYVAL fontFamily AS DWORD, _

    BYREF clonedFontFamily AS DWORD _

) AS LONG

Parameters

 

FontFamily

[in] Pointer to the FontFamily object to clone.

clonedFontFamily

[out] Pointer to a variable that receives a pointer to the new FontFamily object.

 

GdipCreateFontFamilyFromName

 

Description

Creates a FontFamily object based on a specified font family.

Syntax

GpStatus WINGDIPAPI GdipCreateFontFamilyFromName(

    GDIPCONST WCHAR *name,

    GpFontCollection *fontCollection,

    GpFontFamily **FontFamily

);

PowerBASIC Syntax

DECLARE FUNCTION GdipCreateFontFamilyFromName ( _

    BYVAL pName AS STRING, _

    BYVAL fontCollection AS DWORD, _

    BYREF fontFamily AS DWORD _

) AS LONG

Parameters

 

name

[in] Name of the font family. For example, Arial.ttf is the name of the Arial font family.

fontCollection

[in] Pointer to a FontCollection object that specifies the collection that the font family belongs to. If FontCollection is NULL, this font family is not part of a collection. The default value is NULL.

FontFamily

[out] Pointer to a variable that receives a pointer to the new FontFamily object.

 

GdipDeleteFontFamily

 

Description

Deletes the specified FontFamily object.

Syntax

GpStatus WINGDIPAPI GdipDeleteFontFamily(

    GpFontFamily *FontFamily

);

PowerBASIC Syntax

DECLARE FUNCTION GdipDeleteFontFamily ( _

    BYVAL FontFamily AS DWORD _

) AS LONG

Parameters

 

FontFamily

[in] Pointer to the FontFamily object to delete.

 

GdipFontCollectionEnumerable

 

Syntax

GpStatus WINGDIPAPI GdipFontCollectionEnumerable(

    GpFontCollection* fontCollection,

    GpGraphics* graphics,

    INT * numFound

);

PowerBASIC Syntax

DECLARE FUNCTION GdipFontCollectionEnumerable ( _

    BYVAL fontCollection AS DWORD, _

    BYVAL graphics AS DWORD, _

    BYREF numFound AS LONG _

) AS LONG

Parameters

 

fontCollection

[in] Pointer to the font collection object.

graphics

[in] Pointer to the Graphics object.

numFound

[out] Pointer to a variable that receives the number of fonts found in this collection.

 

GdipFontCollectionEnumerate

 

Syntax

GpStatus WINGDIPAPI GdipFontCollectionEnumerate(

    GpFontCollection* fontCollection,

    INT numSought,

    GpFontFamily* gpfamilies[],

    INT* numFound,

    GpGraphics* graphics

);

PowerBASIC Syntax

DECLARE FUNCTION GdipFontCollectionEnumerate ( _

    BYVAL fontCollection AS DWORD, _

    BYVAL numSought AS LONG, _

    BYREF families AS DWORD, _

    BYREF numFound AS LONG, _

    BYVAL graphics AS DWORD _

) AS LONG

Parameters

 

fontCollection

[in] Pointer to the font collection object.

numSought

[in] Long integer value that specifies the number of font families in this font collection.

gpfamilies

[out] Pointer to an array that receives the FontFamily objects.

numFound

[out] Pointer to a variable that receives the number of fonts found in this collection.

graphics

[in] Pointer to the Graphics object.

 

GdipGetCellAscent

 

Description

Gets the cell ascent, in design units, of this font family for the specified style or style combination.

Syntax

GpStatus WINGDIPAPI GdipGetCellAscent(

    GDIPCONST GpFontFamily *family,

    INT style,

    UINT16 * CellAscent

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetCellAscent ( _

    BYVAL family AS DWORD, _

    BYVAL lStyle AS LONG, _

    BYREF cellAscent AS WORD _

) AS LONG

Parameters

 

family

[in] Pointer to the FontFamily object.

style

[in] Long integer value that specifies the style of the typeface. This value must be an element of the FontStyle enumeration or the result of a bitwise OR applied to two or more of these elements. For example, %FontStyleBold OR %FontStyleUnderline OR %FontStyleStrikeout specifies a combination of the three styles.

CellAscent

[out] Pointer to a variable that receives the cell ascent, in design units, of this font family for the specified style or style combination.

 

GdipGetCellDescent

 

Description

Gets the cell descent, in design units, of this font family for the specified style or style combination.

Syntax

GpStatus WINGDIPAPI GdipGetCellDescent(

    GDIPCONST GpFontFamily *family,

    INT style,

    UINT16 * CellDescent

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetCellDescent ( _

    BYVAL family AS DWORD, _

    BYVAL pStyle AS LONG, _

    BYREF cellDescent AS WORD _

) AS LONG

Parameters

 

family

[in] Pointer to the FontFamily object.

style

[in] Integer that specifies the style of the typeface. This value must be an element of the FontStyle enumeration or the result of a bitwise OR applied to two or more of these elements. For example, %FontStyleBold OR %FontStyleUnderline OR %FontStyleStrikeout specifies a combination of the three styles.

CellDescent

[out] Pointer to a variable that receives the cell descent, in design units, of this font family for the specified style or style combination.

 

GdipGetEmHeight

 

Description

Gets the size (commonly called em size or em height), in design units, of this font family.

Syntax

GpStatus WINGDIPAPI GdipGetEmHeight(

    GDIPCONST GpFontFamily *family,

    INT style,

    UINT16 * EmHeight

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetEmHeight ( _

    BYVAL family AS DWORD, _

    BYVAL lStyle AS LONG, _

    BYREF emHeight AS WORD _

) AS LONG

Parameters

 

family

[in] Pointer to the FontFamily object.

style

[in] Integer that specifies the style of the typeface. This value must be an element of the FontStyle enumeration or the result of a bitwise OR applied to two or more of these elements. For example, %FontStyleBold OR %FontStyleUnderline OR %FontStyleStrikeout specifies a combination of the three styles.

EmHeight

[out] Pointer to a variable that receives the size, in design units, of this font family.

 

GdipGetFamilyName

 

Description

Gets the name of this font family.

Syntax

GpStatus WINGDIPAPI GdipGetFamilyName(

    GDIPCONST GpFontFamily *family,

    WCHAR name[LF_FACESIZE],

    LANGID language

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetFamilyName ( _

    BYVAL family AS DWORD, _

    BYVAL pName AS STRING, _

    BYVAL language AS WORD _

) AS LONG

Parameters

 

family

[in] Pointer to the FontFamily object.

name

[out] Name of this font family.

language

[in] Sixteen-bit value that specifies the language to use. The default value is LANG_NEUTRAL, which is the user's default language.

 

GdipGetGenericFontFamilyMonospace

 

Description

Gets a FontFamily object that specifies a generic monospace typeface.

Syntax

GpStatus WINGDIPAPI GdipGetGenericFontFamilyMonospace(

    GpFontFamily **nativeFamily

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetGenericFontFamilyMonospace ( _

    BYREF nativeFamily AS DWORD _

) AS LONG

Parameters

 

nativeFamily

[out] Pointer to a variable that receives a pointer to the FontFamily object that specifies a generic monospace typeface.

 

GdipGetGenericFontFamilySansSerif

 

Description

Gets a FontFamily object that specifies a generic sans serif typeface.

Syntax

GpStatus WINGDIPAPI GdipGetGenericFontFamilySansSerif(

    GpFontFamily **nativeFamily

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetGenericFontFamilySansSerif ( _

    BYREF nativeFamily AS DWORD _

) AS LONG

Parameters

 

nativeFamily

[out] Pointer to a variable that receives a pointer to the FontFamily object that specifies a generic sans serif typeface.

 

GdipGetGenericFontFamilySerif

 

Description

Gets a FontFamily object that specifies a generic serif typeface.

Syntax

GpStatus WINGDIPAPI GdipGetGenericFontFamilySerif(

    GpFontFamily **nativeFamily

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetGenericFontFamilySerif ( _

    BYREF nativeFamily AS DWORD _

) AS LONG

Parameters

 

nativeFamily

[out] Pointer to a variable that receives a pointer to the FontFamily object that specifies a generic serif typeface.

 

GdipGetLineSpacing

 

Description

Gets the line spacing, in design units, of this font family for the specified style or style combination. The line spacing is the vertical distance between the base lines of two consecutive lines of text.

Syntax

GpStatus WINGDIPAPI GdipGetLineSpacing(

    GDIPCONST GpFontFamily *family,

    INT style,

    UINT16 * LineSpacing

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetLineSpacing ( _

    BYVAL family AS DWORD, _

    BYVAL pStyle AS LONG, _

    BYREF lineSpacing AS WORD _

) AS LONG

Parameters

 

family

[in] Pointer to the FontFamily object.

style

[in] Integer that specifies the style of the typeface. This value must be an element of the FontStyle enumeration or the result of a bitwise OR applied to two or more of these elements. For example, %FontStyleBold OR %FontStyleUnderline OR %FontStyleStrikeout specifies a combination of the three styles.

LineSpacing

[out] Pointer to a variable that receives the line spacing of this font family.

 

GdipIsStyleAvailable

 

Description

Determines whether the specified style is available for this font family.

Syntax

GpStatus WINGDIPAPI GdipIsStyleAvailable(

    GDIPCONST GpFontFamily *family,

    INT style,

    BOOL * IsStyleAvailable

);

PowerBASIC Syntax

DECLARE FUNCTION GdipIsStyleAvailable ( _

    BYVAL family AS DWORD, _

    BYVAL lStyle AS LONG, _

    BYREF isStyleAvailable AS LONG _

) AS LONG

Parameters

 

family

[in] Pointer to the FontFamily object.

style

[in] Long integer value that specifies the style of the typeface. This value must be an element of the FontStyle enumeration or the result of a bitwise OR applied to two or more of these elements. For example, %FontStyleBold OR %FontStyleUnderline OR %FontStyleStrikeout specifies a combination of the three styles.

IsStyleAvailable

[out] Pointer to a variable that receives a boolean value indicating if the style or combination of styles is available (TRUE) or not (FALSE).

Remarks

This function returns a misleading result on some third-party fonts. For example, %FontStyleUnderline may return FALSE because it is really testing for a regular style font that also is an underlined font: (%FontStyleRegular OR %FontStyleUnderline). If the font does not have a regular style, the GdipIsStyleAvailable function returns FALSE.

 

Page last updated on Monday, 11 December 2006 11:03:14 +0100