Supported Browsers Home   
MGL_loadFontExt Previous   
MGL_loadIcon Next   
External Functions Up   

MGL_loadFontInstance

Load a font file for use.

Declaration

font_t * MGLAPI MGL_loadFontInstance(
    font_lib_t *fontlib,
    float pointSize,
    float slant,
    float angle,
    ibool antialiased)

Prototype In

mgraph.h

Return Value

Pointer to the loaded font file, NULL on error.

Description

Locates the specified font file and loads it into memory. MGL can load any Windows 2.x style font files (Windows 3.x font files are not supported, but Windows 2.x font files are the standard files even for Windows 3.1. Most resource editors can only output 2.x style font files). Consult the Windows SDK documentation for the format of Windows font files.

When MGL is searching for font files it will first attempt to find the files just by using the filename itself. Hence if you wish to look for a specific font file, you should pass the full pathname to the file that you are interested in. If the filename is a simple relative filename (i.e. “MYFONT.FNT”), MGL will then search in the FONTS directory relative to the path specified in mglpath variable that was passed to MGL_init. As a final resort MGL will also look for the files in the FONTS directory relative to the MGL_ROOT environment variable.

If the font file was not found, or an error occurred while reading the font file, this function will return NULL. You can check the MGL_result error code to determine the cause.

See Also

MGL_openFontLib, MGL_unloadFontInstance, MGL_closeFontLib

Copyright © 2002 SciTech Software, Inc. Visit our web site at http://www.scitechsoft.com