如何使用 c 更改打印字体的字体大小?
printf ("%c", map[x][y]);
我想打印一个比程序中所有其他文本都大的数组。有没有办法让该声明打印得更大?
最佳答案
尽管teppic's answer使用 system()
会起作用,调用外部程序只是为了做到这一点是相当费力的。至于David RF' answer ,它针对特定类型的终端(可能是 VT100 兼容的终端类型)进行了硬编码,并且不支持用户的实际终端类型。
在 C 中,您应该直接使用 terminfo 功能:
#include <term.h>
/* One-time initialization near the beginning of your program */
setupterm(NULL, STDOUT_FILENO, NULL);
/* Enter bold mode */
putp(enter_bold_mode);
printf("I am bold\n");
/* Turn it off! */
putp(exit_attribute_mode);
仍然是teppic注意,不支持更改字体大小。这是在用户的控制之下。
关于c - 如何使用 C 在控制台应用程序中更改字体大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15316455/