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
What is a hash function? Hash function: This is the method from the set 'K' of keys into the set 'L' of memory addresses.   H: K → L These are used to verify the address

Ques.Implement a c/c++ program to find a shortest path between two nodes in a network?network should be taken as an adjacency matrix.

Write a program in C to implement a FTP client that can interoperate with a default FTP server . The client should implement basic FTP commands GET PUT LIST DELE . GET -> to

Hello, Do you have any idea for programming project to simulate a network attack (threat) mechanism or a defense mechanism. Can I get some suggestions for this. Please include th

You are given a collection of words, say as in a dictionary. You can represent it in the following compressed form: the first word will be followed by a sequence of a pair of numbe

Objective: Construct a C program that controls the UART, and is capable of displaying strings. Echo characters received on the UART to the LCD screen Outcome: A mess

#questio A charitable organization wants to design a special ATM machine to be used by needy people. The association supplies the needy person with a pin number to be able to use


Program1: Write a program to find the factorial of a given number. The input is user given. Final output is printed out on to the screen. Program2: Write a program to gene

write a c++ code to implement use of a constructor