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
Program is to store marks and name, roll no in a file: class stud   {     int rno;     char name[20];     int m1,m2,m3;     public:                 void acce

Call by reference: Arguments to a function can be passed in two way; one by call by value and other by call by reference.  Call by value is passed either through a constant

I need whatsapp software in my website Project Description: i need whatsapp software in my website same this whatsapp if anyone can make to me this in my website Skills


Rahul 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 '

A:BinaryHeap.h ------------ #ifndef BINARY_HEAP_H_ #define BINARY_HEAP_H_ #include "dsexceptions.h" #include "vector.h" // BinaryHeap class // CONSTRUCTION: wi

create a shopping cart in c++


A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

A: you can exploit by overloading standard operators on a class, the intuition of the users of that class. This allow users program in the language of the problem domain instead of