Path: utzoo!attcan!uunet!zaphod.mps.ohio-state.edu!ub!uhura.cc.rochester.edu!rochester!kodak!ispd-newsserver!weimer From: weimer@ssd.kodak.com (Gary Weimer) Newsgroups: comp.lang.c Subject: Re: printing underlined text Message-ID: <1990Nov12.183213.8920@ssd.kodak.com> Date: 12 Nov 90 18:32:13 GMT References: <43321@eerie.acsu.Buffalo.EDU> <8611@fmeed1.UUCP> <1990Nov11.153636.13643@mp.cs.niu.edu> Sender: news@ssd.kodak.com Organization: Eastman Kodak Lines: 30 In article <1990Nov11.153636.13643@mp.cs.niu.edu> rickert@mp.cs.niu.edu (Neil Rickert) writes: >In article <8611@fmeed1.UUCP> russ@m-net.ann-arbor.mi.us (Russ Cage) writes: >>In article <43321@eerie.acsu.Buffalo.EDU> haozhou@acsu.buffalo.edu (hao zhou) writes: >>>Does anybody out there know if it's possible to print out underlined >>>text using printf() in C? And how? >> >>This really belongs in comp.lang.c, but... >> >>printf( "Underlined text\015__________ ____\n" ); >> >>ought to work on any ASCII system with printing terminals. >>To use underlining on CRTs or other fancy equipment you >>have to get hardware-specific (or use termcap). >> > > One improvement would be to use: > >printf( "__________ ____\015Underlined text\n" ); > > That way, on a CRT you would at least see the text instead of the >underscores. Another improvement: printf( "_^HU_^Hn_^Hd_^He_^Hr_^Hl_^Hi_^Hn_^He_^Hd _^Ht_^He_^Hx_^Ht\n" ); Although this is much less readable, most "smart" terminals, as well as printers will know how to handle this (see nroff output). Gary Weimer