fgf_define() (Fastgraph/Fonts)

Win32 DirectX Fastgraph/Light

Prototype

int fgf_define (void *fontdata);

Function fgf_define (fontdata() As Any) As Long

function fgf_define (var fontdata) : integer;

Description

The fgf_define() function makes externally loaded font data available to Fastgraph/Fonts. If the function is successful, the font it defines becomes the current font. Generally, this function is used in place of fgf_load() if you want to include the font data directly in your program.

Parameters

fontdata is the array containing the font data. The data in this array must have the same structure as a font file.

Return value

The function returns a font handle between 1 and 256 if successful. Use this font handle with fgf_select() to reference the font. If 256 fonts are already in use, fgf_define() returns zero.

Restrictions

When you define a font with fgf_define(), Fastgraph/Fonts assumes memory management is controlled by your own program. If your program frees memory containing font data and then tries to display characters from that font, the results will be unpredictable.

The fgf_define() function reformats the contents of the fontdata array. This means that once you pass the font data to fgf_define(), you cannot rely on the array's original contents.

See also

fgf_load(), fgf_select(), fgf_undefine()

Examples

FGFW4

Contents
Fastgraph Home Page

 

copyright 2001 Ted Gruber Software, Inc.