c语言 字体显示问题

来源:百度知道 编辑:UC知道 时间:2024/05/27 18:31:02
Win-tc下编译,显示不了TRIPLEX_FONT、SMALL_FONT、SANS_SERIF_FONT、GOTHIC_FONT,均显示为DEFAULT_FONT。
程序没有错误,为tc的示范例程,请达人指点一二。
谢绝小白。
不要复制粘贴,望认真点回答。我这里是字体显示不了,不是如何显示的问题。

曾经看过的类似问题:

C语言中字体的问题
C语言中有两种显示方式,即文本方式和图形方式。就我所知,只能在图形方式下控制字体.
先看一下C中定义的几种字体
名称 索引值 字体说明
DEFAULT_FONT 0 8x8 bit-mapped font
TRIPLEX_FONT 1 Stroked triplex font
SMALL_FONT 2 Stroked small font
SANS_SERIF_FONT 3 Stroked sans-serif font
GOTHIC_FONT 4 Stroked gothic font

(字体说明中的英文解释无须明白,在例子的演示中去看)

请看例子(摘自TC3.0的联机帮助文件)
例一.
#include
#include
#include
#include

/* the names of the text styles supported */
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, "");

/* read