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
Each function has its own stack frame between %fp and %sp. Let Caller calls Callee. Then Caller's %sp becomes callee's %fp, and callee's %sp set to be a new value (a smaller one be

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

Write a program called plus that will display asterisks in the shape of a plus sign which has the height and width specified by the user. You must only allow entry of an odd numb

I have an exercise with 2 problems. One that is partially completed except with read problems with memory overwrite, and the other problem. I have enclosed the instructions documen

Task Your task is to write a program, words, that reports information about the number of words read from its standard input. For example, if the file qbf.txtcontains the text th

The car’s measurements are illustrated, using two arrays. Array 1 = {L, R, L, R, R, L, R, R, L, R, R, L, R, L, L, R, Z}

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

##question.A Padovan string P(n) for a natural number n is defined as: P(0) = ‘X’ P(1) = ‘Y’ P(2) = ‘Z’ P(n) = P(n-2) + P(n-3), n>2 where + denotes string co   program in jav

Damjibhai and Shamjibhai are two jeweler friends. They decide to play a simple game. The game comprises of removing the jewels for polishing, turn by turn. Once a jewel is removed

Project Description: I want a simple program that will spoof my hardware id. I should be able to prepare the id to spoof to in the program and press "random" button to spoof to