Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!samsung!usc!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!mcsun!tuvie!vmars!hp From: hp@vmars.tuwien.ac.at (Peter Holzer) Newsgroups: comp.lang.c Subject: Re: printing underlined text Message-ID: <2006@tuvie> Date: 20 Nov 90 16:32:03 GMT References: <8611@fmeed1.UUCP> <1990Nov11.153636.13643@mp.cs.niu.edu> <1990Nov12.183213.8920@ssd.kodak.com> <1990Nov14.185652.7460@mccc.uucp> Sender: news@tuvie Lines: 41 pjh@mccc.uucp (Pete Holsberg) writes: >In article <1990Nov12.183213.8920@ssd.kodak.com> weimer@ssd.kodak.com (Gary Weimer) writes: >=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). >Only "smart" printers can handle "real-time" backspacing. Our dot >matrix printers won't so we like the "print the underline, return the >carriage, print the text" approach. I don't think that lasers are smart >enough, either. Huh? What does the printf above print on your printer? It works on any matrix printer I have seen and in the worst case it should print ``Underlinedtext'' non-underlined as many terminals do. Many Matrix-Printers will slow down very much on such output because they have to start, print underscore, stop, start backwards, stop, start, print character, stop for each character. Underline\rText is certainly faster on such printers. I certainly see no reason why it should not work on a laser printer. Laser printers are usually quite ``smart''. Note however that there are two backspace characters in the ASCII. BS (0x08, ^H) just moves the cursor to the left, while DEL (0x7F, ^?) deletes the previous character from the print queue (if it exists). The REAL SOLUTION(TM) however is to have a database of means how to get underlining, bold, etc from all your printers, terminals etc. (If you have a UNIX-system, use termcap or termlib) and use this. -- | _ | Peter J. Holzer | Think of it | | |_|_) | Technical University Vienna | as evolution | | | | | Dept. for Real-Time Systems | in action! | | __/ | hp@vmars.tuwien.ac.at | Tony Rand |