> On Thu May 28 19:07:48 EDT 2009, r...@swtch.com wrote:
>> On Thu, May 28, 2009 at 4:08 AM, Gregory Pavelcak
>> <g.pavel...@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


Reply via email to