From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: From: erik quanstrom Date: Tue, 2 Jun 2009 08:02:57 -0400 To: 9fans@9fans.net In-Reply-To: <0cf63c1e74ede4e317b6a57f40537ea2@comcast.net> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Subject: Re: [9fans] eqn and unicode Topicbox-Message-UUID: 02c5d8a4-ead5-11e9-9d60-3106f5b1d025 > 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