emacs-bidi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [emacs-bidi] using fribidi and Pango


From: Behdad Esfahbod
Subject: Re: [emacs-bidi] using fribidi and Pango
Date: Mon, 5 Dec 2005 01:10:51 -0500 (EST)

On Sun, 4 Dec 2005, Eli Zaretskii wrote:

> > Fortunately a lot of data tables and other stuff can be replaced by
> > FriBidi's structures, chopping some 500 lines of it I guess.
>
> If you mean the tables of character properties, then these will
> eventually go away in Emacs as well; see the FIXMEs there.

I was talking from the adopting your code in GNU FriBidi point of
view.

> > The rest needs some restructuring.
>
> What kind of restructuring, and why is it needed?

Well, to be honest, the code is far more complex than what I've
ever seen in any Free Software project.  I think I know how
complex what you are trying to accomplish is, but I don't think
the extra complexity of the incremental algorithm is worth the
effort.  As one can guess, debugging it is a nightmare, and I
think there's a real-world proof of that.

> > But then the question is, is the API usable in more than Emacs
> > only?
>
> Potentially, any display engine that needs to examine text one
> character at a time.
>
> > Even an array containing the input text is being problematic.
> > There's always someone asking for UTF-8, one for UTF-16, another for
> > UTF-32.
>
> You will see that my code calls a bunch of macros to fetch characters.
> Any general-purpose library needs to give these or similar
> macros/functions to the caller as part of the API, because each caller
> will have its own way of walking the characters.  Those functions will
> also take care of converting from whatever representation they use for
> characters into Unicode codepoints.

Yeah, having a callback is a good-enough solution. Having
different functions is the other good (and more widespread)
solution.  I don't really like any of them :(.  But if I am to
choose one, I go multiple-functions way.  I easily get fooled by
the overhead of the callback.


> > I'm more interested to see the highlevel PangoLayout object
> > extended to cover needs of applications like Emacs and AbiWord.
>
> I doubt that heavyweight display monsters like Emacs will ever
> delegate the layout job to libraries.

Ok, I'm not an Emacs user/developer at all, but I really don't
understand why Emacs should be called a heavyweight display
monster.  Most of what Emacs does happens on the logical stream
of text AFAIU.  Theoretically, getting Emacs to use Pango should
be easier than, say, AbiWord.  Practically is the other way
around.

> > And I'm willing to hear more about those needs :).
>
> What do you want to know?
>
> In general, reading xdisp.c and dispnew.c in Emacs sources will give
> you some ideas about what's involved.

Reading.

Anyway, the only reason I spoke up was to tell you that your
contributions to whatever project I'm involved in is always
welcome and appreciated.


Regards,

--behdad
http://behdad.org/

"Commandment Three says Do Not Kill, Amendment Two says Blood Will Spill"
        -- Dan Bern, "New American Language"




reply via email to

[Prev in Thread] Current Thread [Next in Thread]