Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C Library Reference - <u>synopsis:</u> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <graph.h>
    short _FAR _registerfonts( char _FAR *path );

Description:
    The _registerfonts function initializes the font graphics system.  Fonts
    must be registered, and a font selected, before text can be displayed
    with the  _outgtext function.

    The argument path specifies the location of the font files.  This
    argument is a file specification, and can contain drive and directory
    components and may contain wildcard characters.  The _registerfonts
    function opens each of the font files specified and reads the font
    information.  Memory is allocated to store the characteristics of the
    font.  These font characteristics are used by the  _setfont function
    when selecting a font.

Returns:
    The _registerfonts function returns the number of fonts that were
    registered if the function is successful; otherwise, a negative number
    is returned.

Example:
    #include <conio.h>
    #include <stdio.h>
    #include <graph.h>

    main()
    {
        int i, n;
        char buf[ 10 ];

        _setvideomode( _VRES16COLOR );
        n = _registerfonts( "*.fon" );
        for( i = 0; i < n; ++i ) {
            sprintf( buf, "n%d", i );
            _setfont( buf );
            _moveto( 100, 100 );
            _outgtext( "WATCOM Graphics" );
            getch();
            _clearscreen( _GCLEARSCREEN );
        }
        _unregisterfonts();
        _setvideomode( _DEFAULTMODE );
    }

Classification:
    PC Graphics

Systems:
    DOS, QNX

See Also:
    _unregisterfonts, _setfont, _getfontinfo, _outgtext, _getgtextextent,
    _setgtextvector, _getgtextvector

See Also: _unregisterfonts _setfont

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson