基本介紹
- 外文名:setusercharsize
- 類型:函式名
- 用 法: void far setusercharsize
功能,程式例,
功能
為矢量字型改變字元寬度和高度
程式例
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
int main(void)
{
/* request autodetection */
int gdriver = DETECT, gmode, errorcode;
/* initialize graphics and local variables */
initgraph(&gdriver, &gmode, "");
/* 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 */
}
/* select a text style */
settextstyle(TRIPLEX_FONT, HORIZ_DIR, 4);
/* move to the text starting position */
moveto(0, getmaxy() / 2);
/* output some normal text */
outtext("Norm ");
/* make the text 1/3 the normal width */
setusercharsize(1, 3, 1, 1);
outtext("Short ");
/* make the text 3 times normal width */
setusercharsize(3, 1, 1, 1);
outtext("Wide");
/* clean up */
getch();
closegraph();
return 0;
}