groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [groff] improve a few terminal renderings of special characters


From: Ralph Corderoy
Subject: Re: [groff] improve a few terminal renderings of special characters
Date: Thu, 23 Aug 2018 11:38:22 +0100

Hi Ingo,

> > If there's expansions for U+2661 `white heart suit', or U+2665
> > `black heart suit', etc., then they're `H'.
...
> Besides, they do not have an ASCII representation, and i really
> wouldn't see see the point in adding one, given that they don't even
> have a groff character name - and it's good that they don't have a
> name, IMHO.

I agree more groff character names should not be added for these hearts,
and that the two you pointed out that are `Unicode only' seem out of
place in that documentation.

But there's two things going on here.  Mapping `\(HE', etc., and mapping
Unicode runes.  Unicode defines two sets of card suites, each
distinguishing between red and black, e.g. here I see U+2661 as an
outline heart versus the filled-in spade of U+2660.

              +4  troff
    U+2660 →♠  ♤  SP
    U+2661  ♡ →♥  HE
    U+2662  ♢ →♦  DI
    U+2663 →♣  ♧  CL

groff maps its four troff characters onto a mix of the two.

    $ groff -Tutf8 <<<'\(SP\(HE\(DI\(CL' | tr -d \\n |
    > iconv -t ucs-2le | od -An -tx2
     2660 2665 2666 2663

That's what the arrows are marking in the above list.  I'm guessing
that's because they appeared all filled in originally, e.g. with
Hierloom troff pulling in Adobe's Symbol font:

    printf '\\C'\''%s'\''\n' spade heart diamond club |
    ./troff -Tps | ./dpost >/tmp/cards.ps

If the author specifies them by Unicode rune to get an above column of
four then shouldn't `SHDC' appear as approximations for all four,
regardless of column?

> > An emoji heart would be `<heart>', but there doesn't seem to be a
> > simple plain obvious heart emoji, but dozens.  :-)
>
> And those certainly do not deserve assignment of groff character
> names, either.

No, agreed.  So no typesetting of `I❤Unix' using Unicode then?
That would be the place for your `<heart>'.

> > I wonder if John Gardner's HTML-canvas renderer could lay down text
> > in a dark grey that's additive to what's already there, thus
> > over-striking would have an effect, e.g. `\z~o' as well as bold.
> > For plus points, every glyph placed could have a slight random
> > `jitter' applied to both its coordinates so bold was also thicker,
> > except around the edges.  Half-line motions would be nice too, John.
> > ;-)
>
> Right, and i want ponies.  And cute little unicorns!  ;-)

I don't think PostScript's graphic model offers compositing two
overlapping 0.7 greys to a saturated 1.0 black, but GhostScript's
https://www.ghostscript.com/doc/9.23/Language.htm#Additional_operators
borrows from PDF 1.4.  Heirloom's nroff still produces ASR-33 codes by
default.  PostScript from them aiming at over-striking shouldn't be
hard, and GhostScript could then produce PDF, PNGs, ...  :-)

-- 
Cheers, Ralph.
https://plus.google.com/+RalphCorderoy



reply via email to

[Prev in Thread] Current Thread [Next in Thread]