Printing double-size characters with Ncurses

时光总嘲笑我的痴心妄想 提交于 2019-12-10 11:05:01

问题


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?


回答1:


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)

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.

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.



来源:https://stackoverflow.com/questions/3470106/printing-double-size-characters-with-ncurses

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!