> 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"?

i'm pretty sure that's wrong for reswords like "≥" or "and".
a font change would also change the appearance of existing
documents.  my change also changes the appearance of
existing documents, but only those that use the relatively-
new unicode input.

on the other hand, for Γ to be treated the same as G,
one would need a new table gktbl() that would be added
here

/sys/src/cmd/eqn/text.c:85,91
        else if ((tp = lookup(restbl, p1)) != NULL) {
                p = tp->cval;
        } else {
+               if (tp = lookup(gktbl, p1)) != NULL)
+                       p = p1 = tp->cval
                lf = rf = 0;
                lastft = 0;
                nclass = NONE;  /* get started with no class == no pad */
                csp = cs;

one would also need to modifiy isalpharune to return
true for greek letters.  or just use the system isalpharune.
i'm sure one could find a number of other bugs.

the reason i didn't suggest this is because it changes old
documents.  perhaps we should just take our lumps and
fix the problem.

- erik

Reply via email to