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/C++ v10.0 : C library - <b>synopsis:</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <graph.h>
    short _FAR _getfontinfo( struct _fontinfo _FAR *info );

Description:
    The _getfontinfo function returns information about the currently
    selected font.  Fonts are selected with the  _setfont function.  The
    font information is returned in the _fontinfo structure indicated by the
    argument info.  The structure contains the following fields:

    type
        1 for a vector font, 0 for a bit-mapped font

    ascent
        distance from top of character to baseline in pixels

    pixwidth
        character width in pixels (0 for a proportional font)

    pixheight
        character height in pixels

    avgwidth
        average character width in pixels

    filename
        name of the file containing the current font

    facename
        name of the current font


Returns:
    The _getfontinfo function returns zero if the font information is
    returned successfully; otherwise a negative value is returned.

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

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

    main()
    {
        int width;
        struct _fontinfo info;

        _setvideomode( _VRES16COLOR );
        _getfontinfo( &info );
        _moveto( 100, 100 );
        _outgtext( "WATCOM Graphics" );
        width = _getgtextextent( "WATCOM Graphics" );
        _rectangle( _GBORDER, 100, 100,
                    100 + width, 100 + info.pixheight );
        getch();
        _setvideomode( _DEFAULTMODE );
    }

Classification:
    PC Graphics

Systems:
    DOS, QNX

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