C program to design text styles, C/C++ Programming

Program to design text styles:

Write a C program to design different text style

char *fname[] = { "DEFAULT font",

                                  "TRIPLEX font",

                                  "SMALL font",

                                  "SANS SERIF font",

                                  "GOTHIC font"

                                };

int main(void)

{

   /* request auto detection */

   int gdriver = DETECT, gmode, errorcode;

   int style, midx, midy;

   int size = 1;

 

   /* initialize graphics and local variables */

   initgraph(&gdriver, &gmode, "f:\\software\\tc\\include");

 

   /* read result of initialization */

   errorcode = graphresult();

   if (errorcode != grOk)  /* an error occurred */

   {

      printf("Graphics error: %s\n", grapherrormsg(errorcode));

      printf("Press any key to halt:");

      getch();

      exit(1); /* terminate with an error code */

   }

 

   midx = getmaxx() / 2;

   midy = getmaxy() / 2;

 

   settextjustify(CENTER_TEXT, CENTER_TEXT);

 

   /* loop through the available text styles */

   for (style=DEFAULT_FONT; style<=GOTHIC_FONT; style++)

   {

      cleardevice();

      if (style == TRIPLEX_FONT)

                 size = 4;

 

      /* select the text style */

      settextstyle(style, HORIZ_DIR, size);

 

      /* output a message */

      outtextxy(midx, midy, fname[style]);

      getch();

   }

 

   /* clean up */

   closegraph();

   return 0;

}

Posted Date: 10/19/2012 5:42:57 AM | Location : United States







Related Discussions:- C program to design text styles, Assignment Help, Ask Question on C program to design text styles, Get Answer, Expert's Help, C program to design text styles Discussions

Write discussion on C program to design text styles
Your posts are moderated
Related Questions
Writing and compiling a program from a given Use Case definition. Follow the Average Temperature in Paradise

Within C we access external devices by means of a pointer i.e. address. The address could point to any memory mapped device i.e. Ram, Rom, Duart, Disk drives etc. Therefore there i


Ravi is a newbie to the programming and while learning the programming language he came to know the following rules: · Each program must start with ''''{'''' and end with ''''}


Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec


# include stdio.h> # include string.h> # include conio.h> void main()   {           int i=0,count=0;           char a[100],b;           clrscr();

the program that solve the efficiency of otto cycle

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b