From: Gregory Pavelcak <g.pavelcak@comcast.net>
To: 9fans@9fans.net
Subject: Re: [9fans] eqn and unicode
Date: Tue, 2 Jun 2009 07:41:17 -0400 [thread overview]
Message-ID: <0cf63c1e74ede4e317b6a57f40537ea2@comcast.net> (raw)
In-Reply-To: <eb44f8dfdf514930ab7b5ffc48bf7fb9@quanstro.net>
> On Thu May 28 19:07:48 EDT 2009, rsc@swtch.com wrote:
>> On Thu, May 28, 2009 at 4:08 AM, Gregory Pavelcak
>> <g.pavelcak@comcast.net> wrote:
>> > If you write the eqn-word for a greek letter, "GAMMA" for
>> > example; eqn passes the unicode character (the output of
>> > Alt-*G) to troff. If, on the other hand, you type Alt-*G in eqn,
>> > it passes `"\f2Γ\fP' to troff, thus producing, by my lights anyway,
>> > a nicer looking character. I was just wondering if this was
>> > intended as a way to give people both a roman-greek letter
>> > and an italic one, or if it was intended to discourage the use
>> > of eqn's letter names in favor of unicode, or if it just sorta
>> > happened. Perhaps none of the above. Anyone know?
>>
>> Eqn should not generate different output for GAMMA vs Γ.
>> Feel free to fix it.
>
> this is an interesting case. fonts are not applied to symbols
> in the resword table. the following fix does solve the problem
> with historical correctness. if the font is ugly, perhaps a better
> font is in order. :-)
>
> - erik
Hmm. I submitted a patch so that fonts would apply to resword
rather than making it so that they don't apply to greek letters,
and I'm not even sure I did that right.
diff -c /sys/src/cmd/eqn/text.c /usr/gp/sys/src/cmd/eqn/text.c
/sys/src/cmd/eqn/text.c:83,89 - /usr/gp/sys/src/cmd/eqn/text.c:83,90
else if (t == TAB)
p = "\\t";
else if ((tp = lookup(restbl, p1)) != NULL) {
- p = tp->cval;
+ sprintf(cs, "\\f%s%s\\fP", ftp->name, tp->cval);
+ p = cs;
} else {
lf = rf = 0;
lastft = 0;
Now I don't know what's right. What if, for example, you
use "gfont H"? Shouldn't that really make Γ get passed to
troff as "\fHΓ\fP"?
Greg
next prev parent reply other threads:[~2009-06-02 11:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-28 23:06 Russ Cox
2009-06-01 22:45 ` erik quanstrom
2009-06-02 11:41 ` Gregory Pavelcak [this message]
2009-06-02 12:02 ` erik quanstrom
2009-06-02 16:42 ` Gregory Pavelcak
2009-06-02 16:58 ` erik quanstrom
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=0cf63c1e74ede4e317b6a57f40537ea2@comcast.net \
--to=g.pavelcak@comcast.net \
--cc=9fans@9fans.net \
/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).