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:");


      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++)



      if (style == TRIPLEX_FONT)

                 size = 4;


      /* select the text style */

      settextstyle(style, HORIZ_DIR, size);


      /* output a message */

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




   /* clean up */


   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
A name clash happens when a name is described in more than one place. For example, two dissimilar class libraries could give two different classes the similar name. If you try to u

Given an integer n and a permutation of numbers 1, 2 ... , n-1, n write a program to print the permutation that lexicographically precedes the given input permutation. If the given

plaese tell the full program for the above given topic with the input and output

recsection method source code for searching position

Operators in C++: All C operators are valid operators in C++ also.  Besides C++ has developed some new operators like Operators and their Expression: 1.      Logical op

Project Description: I am seeking a developer who can start an app from scratch and get it delivered to me as soon as possible. It is a little android based app. A background on

push and pop operation using array draw flowcharts


Write a program to calculate the timetable for numbers 1 -> 10 and display them as follows. Your solution should use for do loops      #include stdio.h void main() {    char p