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

Assignment Help:

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;

}


Related Discussions:- C program to design text styles

Write a structured and annotated c program, Intelligent homes are becoming ...

Intelligent homes are becoming increasingly popular as the cost/performance ratio of microcontrollers is continuously dropping.  These systems incorporate various transducers to de

Do friends break encapsulation?, A: No. If they're utilized properly, they ...

A: No. If they're utilized properly, they increase encapsulation. You frequently require splitting a class in half while the two halves will have distinct numbers of instances o

Use of a windows box, This program requires the use of a windows box, no co...

This program requires the use of a windows box, no console applications are allowed. Prepare for Christmas now.  Each year, Reindeer Gift Emporium publishes a Christmas price list

Define array of structures, Define Array of Structures? An Array of Str...

Define Array of Structures? An Array of Structures is an assortment of the same data types which are declared as structures. It is useful to store large and different number of

StACK, Q. Explain that how do we implement two stacks in one array A[1..n] ...

Q. Explain that how do we implement two stacks in one array A[1..n] in such a way that neither the stack overflows unless the total number of elements in both stacks together is n.

Random searching, write aprogram for random -search to implement if a[i]=x;...

write aprogram for random -search to implement if a[i]=x;then terminate other wise continue the search by picking new randon inex into a

C pgms, find area under the curve y=f(x) between x=a &y=b integrate y=f(x)

find area under the curve y=f(x) between x=a &y=b integrate y=f(x)

Opp, what is oops

what is oops

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd