使用 Ncurses 打印双倍大小的字符
许多终端模拟器(xterm、Konsole)支持双倍大小字符。 Ncurses 不支持这一点,据我所知,ncurses 不会打印转义字符(\033 将不转义并以明文形式打印)。
是否有可能在 ncurses 应用程序中打印双倍大小的字符?
Many terminal emulators (xterm, Konsole) support double-size characters. Ncurses does not support this and as far as I know, ncurses will not print escape characters (\033 will be unescaped and printed in clear text).
Is it possible at all to print double-size characters in a ncurses application?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您引用的“双倍大小”字符功能由以下 ANSI 序列设置(找到 此处):
\e#3
属性使终端切换字符集为仅包含每个字符的上半部分。同样,\e#4
切换到包含下半部分的字符集。通过将它们一起使用,终端可以在两个单独的行上显示“双倍高度”文本。
据我所知,你是对的 - ncurses 还没有“实现”它们 - 也许是因为它们依赖于 DECTerminals 最初独有的专用字体集。
言归正传,这似乎不可能,因为 ncurses 没有此功能的属性,尽管我承认找不到任何直接说明它不是的参考资料可能的。也许具有疯狂 terminfo 技能的人可以解释为什么是(或不是)这种情况。
The "double-size" character capability you refer to is set by the following ANSI sequences (found here):
The
\e#3
attribute makes the terminal switch character sets to one which only contains the top-half of each character. Similarly,\e#4
switches to a character set containing the bottom-half. By using these together,the terminal can display a "double-height" text on two separate lines.
As far as I can tell you're right - ncurses hasn't "implemented" them - perhaps because they rely on a specialized fontset originally unique to DECTerminals.
Getting to the point, it doesn't seem possible since ncurses has no attribute for this feature, although I admittedly can't find any reference directly stating that it isn't possible. Perhaps someone with crazy terminfo skills can explain why this is (or isn't) the case.