_getfontinfo

Description

Gets the current font characteristics.

#include <graph.h>

short __far _getfontinfo( struct _fontinfo __far *fontbuffer );

fontbuffer Buffer to hold font information  

Remarks

The _getfontinfo function gets the current font characteristics and stores them in a _fontinfo structure, defined in GRAPH.H.

The _fontinfo structure contains the following elements:

Element Contents

int type Specifies vector (1) or bitmapped (0) font
int ascent Specifies pixel distance from top to baseline
int pixwidth Specifies the character width in pixels; 0 indicates a proportional font
int pixheight Specifies the character height in pixels
int avgwidth Specifies the average character width in pixels
char filename [81] Specifies the filename, including the path
char facename [32] Specifies the font name

Return Value

The _getfontinfo function returns a negative number if a font has not been registered or loaded.

Compatibility

Standards:None

16-Bit:DOS

32-Bit:None

See Also

_getgtextextent, _outgtext, _registerfonts, _setfont, _setgtextvector, _unregisterfonts

Example

See the example for _outgtext.