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 _getgtextextent( char _FAR *text );

Description:
    The _getgtextextent function returns the length in pixels of the
    argument text as it would be displayed in the current font by the
    function  _outgtext.  Note that the text is not displayed on the screen,
    only its length is determined.

Returns:
    The _getgtextextent function returns the length in pixels of a string.

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

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

See Also: _registerfonts _unregisterfonts

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