text height

textheight() function returns the height of the specified string. textheight() function gives the height of string which is based on the current setting of the settextstyle() function which is used to change font style family and direction of the text.

Declaration

int textheight(char *string);
  • textheight() function contains only one argument which represent the string whose height has to be calculated.
  • For better understanding go through the program:

Program

#include<stdio.h>

#include<conio.h>

#include<graphics.h>

void main()

{

int gd=DETECT, gm,w;

char arr[100];

initgraph(&gd,&gm," ");

w=textheight("graphics programming");

sprintf(arr,"textheight of given string=%d",w);

outtextxy(320,240,arr);

getch

closegraph();

}

Above program gives the height of the string "graphics programming". textheight() function is used to find out the height of the specified string.

Output

c graphics