MGL_enumerateFonts

Enumerates all available font families.

Declaration

void MGLAPI MGL_enumerateFonts(
    enumfntcallback_t callback,
    void *cookie)
typedef ibool (MGLAPIP enumfntcallback_t)(const font_info_t *info, void *cookie)

Prototype In

mgraph.h

Parameters

callback

function that will be called for each font family

cookie

pointer to user data that will be passed to callback function

 

Description

This function finds all fonts in current directory and standard MGL locations and calls the callback function for every font family it has found. If the callback returns false, MGL_enumerateFonts immediately returns, even if it hasn't yet iterated over all available fonts.

The cookie argument is useful in multithreaded environment where it is neccessary to distinguish between several concurrently running enumerations.

This function will scan directories for fonts when called for the first time. All subsequent calls are more efficient, because MGL_enumerateFonts will use font cache stored in memory.

MGL_enumerateFonts will attempt to create file named fntcache.inf in directories it scans for fonts. This file contains information about all fonts in the directory and will subsequently be used to further speed up fonts enumeration.

See Also

font_info_t

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