ncurses support for italics?

梦想与她 提交于 2019-12-24 11:59:13

问题


Some terminals, such as urxvt, support display text in italics via the sitm and ritm terminfo entries:

echo `tput sitm`italics`tput ritm`

I'd like to use this in an application I've got which wants to render real italics into the console. Unfortunately the application is ncurses-based, and ncurses doesn't seem to have a attribute for italics --- it's got a whole bunch, including invisible text (which I'm sure is useful for something), but no italics.

Does anyone know of a way to trick ncurses into displaying italic text, or am I going to have to ditch ncurses and rewrite the program to use raw terminal sequences?


回答1:


It looks like ncurses 5.10 will contain A_ITALIC. The change went in on September 31 2013:

http://invisible-island.net/ncurses/NEWS-contents.html#t20130831

pdcurses supports A_ITALIC as well so there's at least a vague nod to compatibility. Unfortunately, this won't help me much until 5.10 is released and then becomes widespread...



来源:https://stackoverflow.com/questions/20107632/ncurses-support-for-italics

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