The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: random832@fastmail.com (Random832)
Subject: [TUHS] getting nroff to underline in v6,v5
Date: Sun, 27 Sep 2015 14:12:14 -0400	[thread overview]
Message-ID: <m21tdjivep.fsf@fastmail.com> (raw)
In-Reply-To: <CADxT5N70c5pTHYgn2J7fN7FnrgXSeP=h=ep2g7X0bkwsoSKt1Q@mail.gmail.com>

Mark Longridge <cubexyz at gmail.com> writes:

> It seems that nroff had the ability to show underlined text very early
> on, possibly as early as v3 according to the v3 manual.
>
> I haven't managed to get this to work right under simh but I was
> thinking maybe there's a way to do it. It needs an 'underline font'
> but the mechanism of how this worked in the old days is a bit of
> mystery to me. The output device would have to have the ability to
> either display or print underlined text. Maybe someone can remember
> which terminal devices supported this in the old days which worked
> "out of the box" in the v5,v6 era.
>
> Maybe there was the ability to use overstrike characters on the teletype?
>
> In bash I can use:
>
> echo -e "\e[4munderline\e[0m"

The proper escape sequence to end underline is technically \e[24m; using
0 here ends all other formats (bold, color) as well.

> Shouldn't be too hard to hack up something that works in emulated v5.

The "ul" utility, which converts from overstrikes to termcap-based
escape sequences, first appeared in 3.0BSD.

The source code is here:
http://minnie.tuhs.org/cgi-bin/utree.pl?file=3BSD/usr/src/cmd/ul.c

It'd probably be pretty easy to rip out the termcap dependency and have
it just output ansi codes, though I don't know what dialect of C works
on v5.

1BSD to 3BSD also had an "iul" utility which just printed a row of
dashes under characters to be underlined instead of using escape
sequences. In 2.9BSD and 4BSD and later this functionality is provided
by "ul -i".

http://minnie.tuhs.org/cgi-bin/utree.pl?file=1BSD/s6/iul.c

It looks like this wouldn't be hard to modify to use escape sequences
instead, and it uses the oldest C dialect of any of these versions.

From 4.1c BSD, ul also handles bold, which is represented by
self-overstriking in the nroff output, and represents superscript and
subscript (half-linefeed) with dim attributes. Any missing attributes
are represented with standout. This is essentially the same
functionality available in modern versions of ul.




  parent reply	other threads:[~2015-09-27 18:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-27  8:33 Mark Longridge
2015-09-27 15:51 ` John Cowan
2015-09-27 16:10   ` Ronald Natalie
2015-09-27 23:55     ` scj
2015-09-27 18:00 ` Clem Cole
2015-09-27 18:12 ` Random832 [this message]
2015-09-27 23:48 Doug McIlroy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m21tdjivep.fsf@fastmail.com \
    --to=random832@fastmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).