使用Ncurses打印双倍字符 [英] Printing double-size characters with Ncurses

查看:121
本文介绍了使用Ncurses打印双倍字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

许多终端仿真器(xterm,Konsole)均支持两倍大小的字符. Ncurses不支持此功能,据我所知,ncurses不会打印转义字符(\ 033将不转义并以明文打印).

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).

是否可以在ncurses应用程序中打印双倍字符?

Is it possible at all to print double-size characters in a ncurses application?

推荐答案

您所指的双倍大小"字符功能由以下ANSI序列设置(位于

The "double-size" character capability you refer to is set by the following ANSI sequences (found here):


    ESC # 3   DEC double-height line, top half (DECDHL)
    ESC # 4   DEC double-height line, bottom half (DECDHL)

\e#3属性将终端开关字符集设置为仅包含每个字符的上半部分的字符集.同样,\e#4切换到包含下半部分的字符集.通过一起使用,

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,

echo -e "\e#3Foo\n\e#4Foo"

终端可以在两条单独的行上显示双倍高度"文本.

the terminal can display a "double-height" text on two separate lines.

据我所知您是对的-ncurses尚未实现"它们-可能是因为它们依赖于DECTerminals独有的专用字体集.

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.

要点到了,似乎不可能,因为ncurses对此功能没有属性,尽管我承认找不到直接说明它的参考资料是不可能的.也许那些具有疯狂的terminfo技能的人可以解释为什么是(或不是)这种情况.

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.

这篇关于使用Ncurses打印双倍字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆