Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Borland C++ 2.x ( with Turbo C ) - justification http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Justification
 gettextsettings()       Get Text Font, Direction, Size and Justification

 #include   <graphics.h>
 void far                    gettextsettings(tview);
 struct textsettingstype far *tview;

    gettextsettings() gets information about the current text font,
    direction, size and justification (horizontal or vertical) and stores
    it in a structure of type textsettingstype. This structure is pointed
    to by 'tview' and is defined in <graphics.h> as:

     struct textsettingstype {
          int font;
          int direction;
          int charsize;
          int horiz;
          int vert;
     };

    The font can be an 8x8 bit-mapped font or one of several "stroked"
    fonts available.  The 8x8 bit-mapped font is the default.  The font
    direction can be either horizontal text (left to right) or vertical
    text (rotated 90 degrees counterclockwise). The character size allows
    each character to be magnified by a specific factor. Horizontal and
    vertical factors determine how the character is centered. For more
    specific information on all the text settings see settextstyle() and
    settextjustify().

    Returns:     Nothing.

       Note:    Stroked fonts are typically stored on disk. If an error
                occurs during the attempt to retrieve a stroked font,
                graphresult() can be used to return one of the following
                values:
                -8    Font file not found
                -9    Insufficient memory to load selected font
                -11   (General Error)
                -12   Graphics I/O error
                -13   Invalid font file
                -14   Invalid font number

   -------------------------------- Example ---------------------------------

    The following statements save the original text settings, change the
    settings and print an example, then restore the original settings.

           #include <graphics.h>
           #include <conio.h>

           main()
           {
              int gdriver = DETECT;
              int gmode;
              struct textsettingstype textset;

              initgraph(&gdriver,&gmode,"");
              gettextsettings(&textset);
              outtextxy(100,32,"Default text settings");
              getch();
              settextstyle(GOTHIC_FONT,HORIZ_DIR,5);
              outtextxy(100,100,"Gothic Font");
              getch();
              settextstyle(textset.font,textset.directions,textset.charsize);
              outtextxy(100,200,"Restore default text settings");
              getch();
              closegraph();
           }


See Also: settextjustify() settextstyle()

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