"Stephen J. Turnbull" <stephen(a)xemacs.org> writes:
>>>>> "Matthias" == Matthias Neubauer
<neubauer(a)informatik.uni-freiburg.de> writes:
Matthias> I don't see where our patch would add "substantial
Matthias> complexity" to any of those or other areas you mentioned
Matthias> above.
Well, I've tried working on all of them, and it _does_ add complexity,
at least given my skills. Much of the complexity is because the Xft
stuff is not properly abstracted, but rather #ifdef'd into place.
This would fit naturally with improvements in face and font
description.
I guess you are talking about the redisplay code here, right? It's
hard for me to figure out from your description above, what kind of
code you are expecting here? Right now we have several redisplay
implementations (tty, Windows, X, X w/ Mule, X w/ Xft, GTK,
etc.). They are all either living in separate source files, or they
are further separated by #ifdefs. I guess there where reasons for
using this design: you want to happen all the redisplay stuff as fast
as possible. And since the redisplay mechanism can be chosen
statically (by configure and the given configure flags), you also want
to choose your (specialized) redisplay code at compile
time. Otherwise, you would introduce all sorts of dynamical dispatches
into the display code for which I see no reason for---your drawing
routines are statically determined.
On the lisp level on the other hand, there exists one general
dispatching mechanism that dynamically selects the appropriate font
selection and customization code depending on your actual
display. Here, we just added code to the dispatcher that delegates
calls in case of xft fonts to our own emacs lisp code. The actual
emacs lisp implementation handling Xft lives in separate files.
Or am I missing your point here? If so, you have to be more concrete
about what kind of abstractions you are missing specifically at which
places in our Xft code.
Matthias> I totally agree that having a great, unifying font
Matthias> description scheme incorporated into XEmacs would surely
Matthias> be an awesome thing. But I think this is a whole other
Matthias> project.
Yes. One that should be at least in the _design review stage_ before
your patch is accepted for 21.5. As I say, I feel your pain.
Matthias> you mean by "two-octet Unicode" and "error
checking"?
"Two-octet unicode" was a mistake. Yuri/Aleksey's patch uses UTF-8.
The problem is the same, however. X11 historically just pukes if you
feed it data it doesn't expect. Routines that call into X without
doing range-checking on the arguments are simply crashes waiting to
happen. Do you know what happens if an illegal character is given for
one of those fonts? If you do, please document it. (Note that you
may not assume at this point that the Mule routines themselves know
what they are doing---anything can get passed into Xft: illegal
characters, malformed UTF-8, and you either have to know the Xft will
gracefully signal an error so you can catch it, or catch the bad data
yourself.)
Well, that all sounds to me, as if it's just impossible for us to fix
the interplay of Xft and Mule right now by ourselves unless someone
fixes Mule first. Or tells us how to use it correctly. All we want is
a simple routine that translates the currently encoded string into the
correct Utf8 translation. I don't want to be forced to first analyze
the converted string, or to even do some fancy conversion on it by
myself inside the redisplay code. After all, this is redisplay code we
are talking about here. If something like this was in place, all we'd
have to do then is to pass Utf8 strings to Xft.
The Xft drawing routines never signal an error. Unfortunately I can't
tell you what they'll do if they get malformed input---there is no
written specification for Xft available somewhere. All I'd rely on is,
that the Xft routines at least "draw something" on the screen, as long
as they get proper Unicode (Utf8) strings. (I usually see a squared
box on the screen for characters that are unsupported by the currently
used font.)
Given a working Mule (e.g. a Mule that can convert between character
sets and UTF 8 correctly), adding Xft support to it should be a one
day project. We already have the supplementary patch from Yuri and
Alkesey.
It would be really cool if some of you, the XEmacs/Mule guys, could
look at their Unicode conversion and tell us whether this is the right
thing to do to get such an Utf8 conversion. Or otherwise tell us how
to fix it. Given that, I am more than happy to integrate it in our
stuff to enable Mule support right away.
Matthias> I once integrated their patch into my workspace,
built a
Matthias> Mule/XEmacs and fiddled around with it quite
Matthias> bit. Unfortunately the patch didn't seem to work for me:
Matthias> already visiting buffers with just Latin1 text showed
Matthias> some wrong character translations of the "upper half" of
Matthias> the latin1 char set. Unfortunately I never managed to
Matthias> figure out whether the unicode translation is broken or
Matthias> I am just unable to use XEmacs with different character
Matthias> encodings correctly.
Matthias> We also discovered all those problems you describe
Matthias> above. And that's why the latest patch leaves all the
Matthias> widget code (lwlib) completely untouched, as you
Matthias> hopefully noticed.
Actually, I was rather disappointed. But we have different viewpoints.
But you're saying you _have_ tried several of these desirable things,
failed, don't know why---and still you claim you see no additional
complexity? Think again; are you kidding yourself?
Sure, I do know why!?! Again, while starting to fiddle with the lwlib
stuff, I soon realized that the current widget set simply isn't
extendable in ways we would need to extend it for new features such as
nicer fonts, customization support, etc. As I said, the reason is that
the Lucid widget set is tightly coupled to the Xt library. Enhancing it
in any respect is gonna be a pain (and/or a gross hack). This is not a
problem that is intrinsic to the addition of Xft fonts only.
Matthias> Then, there seems no (obvious) way to incorporate
the
Matthias> automatic selection of charsets into the current font
Matthias> selection scheme using just pattern strings and
Matthias> Customize.
Yup, and that needs to come first IMO.
Why is that? Is the Windows font scheme or the X font scheme doing it
automatically (and correctly) right now?
Matthias> do you really foresee [fixing custom and the font
model]
Matthias> to happen in the not-too-distant future?
Not if someone doesn't push for it to happen. It does need to happen,
or XEmacs will lose users that it really should have.
Matthias> Are there any plans to do this?
Ben has some ideas that are related, Hrvoje has some ideas
specifically along these lines, I have some ideas. If there are
features in the queue that are waiting, we'll have more incentive to
turn them into "plans", and those who have features they want in will
help us to design something that works for everybody.
As Hrvoje pointed out Xft font handling at moment only works by
introducing another kludgy font scheme. A unified font description
model would be the right thing in this situation. The plan, as far as
we got that, is to introduce something like an abstract data type
along with some operations on that ADT. I think you once noted that
fontconfig's API might give a guideline for finding that set of
operations. But clearly we would need our own, private layer on top of
all the existing or future font description implementations.
(Otherwise you are of course completely tied to one specific
technology. In addition, such a technology usually is only available
on certain platforms.) Then, these operations need to be implemented
for all the different font models: An implementation for XLFD-Fonts,
an implementation for Windows-Fonts, etc. We'd argue now, that, with
our Xft/FC support integrated, an implementation for Fontconfig would
probably very cheap: Eric already hacked most of the bindings for
fontconfig. This looks like a small, additional layer of glue code to
me for the Fontconfig implementation... On the other hand,
implementing this for maybe Windows or X fonts seems much harder. You
basically have to reimplement something like "Fontconfig Lite" for
those schemes then.
Matthias> Are there any people willing to work on this?
Dunno. I don't know what Ben plans or has time for, or Hrvoje. I'll
probably have some time for the next couple of months, but I'm not the
programmer that some of the other guys are.
ms> but defaulting it to off for now? (And forcing it to off with
ms> Mule.)
>> Ie, nobody using Mule sees it, nobody fixes the breakage, and
>> the problems get worse with every Mule-ignorant patch. No,
>> thank you.
Matthias> Our Mule users see some nice Xft-enabled XEmacs at their
Matthias> neighbors', they get jealous, do their homework and fix
Matthias> the breakage in no time at all ... :-)
You don't fix design breakage in no time at all.
ms> We've been over this often: branches in CVS simply don't work
ms> well enough to support this model gracefully.
>> I've been following this patch for months in a local workspace.
>> All you need to do is keep a separate ChangeLog. This ain't
>> brain surgery, or even KKCC. Nobody is currently working on
>> any of the related areas (lwlib, redisplay, Custom, faces).
Matthias> I'm not in favor of a separate branch either. We all
Matthias> know how it ends ...
Yeah. You put on your waders, step into the muck, start shoveling,
and several hours or days later you have a merged workspace. Even in
free software, not everything can be fun. Not all patches should be
merged. Etc.
Matthias> So, are there any ways to resolve the current situation?
You'll notice I haven't issued a formal veto, yet. All I want at this
stage is to talk about the issues before we commit something that
really looks fishy to me, precisely because you're not interested in
addressing any of the fundamental breakage.
Unfortunately it's very hard for us to tell what precisely is the
understanding of "addressing the fudamental breakages" here? Is it
just about adding some more comments, assertions, and procedures at
the right places in our redisplay code? Or do we first have to fix
Mule, integrate a new widget set, and implement the great unified font
scheme before something would happen? Maybe it would be wise to pin
down the specific issues and goals more precisely. I hope this might
all help us to decide how and where and if we proceed.
--
Matthias Neubauer |
Universität Freiburg, Institut für Informatik | tel +49 761 203 8060
Georges-Köhler-Allee 79, 79110 Freiburg i. Br., Germany | fax +49 761 203 8052