You are here

Settextstyle function in c

Settextstyle function is used to change the way in which text appears, using it we can modify the size of text, change direction of text and change the font of text.

Declaration: void settextstyle( int font, int direction, int charsize);
font argument specifies the font of text, Direction can be HORIZ_DIR (Left to right) or VERT_DIR (Bottom to top).

Different fonts

enum font_names

C programming source code for settextstyle

#include <graphics.h>
#include <conio.h>
   int gd = DETECT, gm, x = 25, y = 25, font = 0;
   for (font = 0; font <= 10; font++)
      settextstyle(font, HORIZ_DIR, 1);
      outtextxy(x, y, "Text with different fonts");
      y = y + 25;
   return 0;
Share this