Subject: Re: detecting fribidi?

From: Olivier Chapuis <[email-masked]>
Date: Sun, 3 Mar 2002 08:09:09 +0100

On Tue, Feb 26, 2002 at 07:06:06PM +0000, Mikhael Goikhman wrote:
> 
> This is because HAVE_FRIBIDI is not really used yet anywhere.
> Olivier, you may do it before me if you like. I am busy with perl now. :)
>

Ok, I will try to start. At least I will try to find out which
is the "canonical charset" used by a given font (this is needed
by iconv). But in fact it seems to me that it is difficult to
determine when the fribidi filter should be applied to a string.
Let us say that we use the capCTL encoding for the discussion
(caps string are right to left, so fribidi reverse caps string).
In a menu if the visual label should be ABCDE, if the user
enter the line
	addtomenu foo "EDCBA" exec exec xyz
in the config file, fribidi filter should be applied. But if the
user use a bidi editor (or enforce it) it will type:
	addtomenu foo "ABCDE" exec exec xyz
and no fribidi conversion should be applied.
There is a similar problem with window title: for a RTL encoding
in which direction bidi application will set the WM_NAME? IMHO
the application should give the name in the good direction and so
fribidi is not needed. Similar problems arise when the user gives
the window title name with via  command line.

So it seems to me that fribidi is useful only if the locale
charest is UTF-8 (or when the user specify an iso10646-1/UTF-8
font) as there is clear specification for bidi UTF-8 string.

Nadim, any opinion? As you ask for bidi support in fvwm can
you explain in some details where are the problem with fvwm
for a user which needs bidi.

Olivier
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Nadim Shaikli <[email-masked]>
Date: Sun, 3 Mar 2002 00:16:40 -0800 (PST)

> and no fribidi conversion should be applied.

Keep in mind that there are two orders here - logical (ie. what's stored
on disk) and visual (ie. what is/should be displayed).  A unicode aware
editor with Bidi will indeed display things correctly, the storage though
will amount to it being stored in latin order (ie. its stored in 
the order a user types; "type-order" if you will).  To follow your example
above, the user should not reverse-enter anything (that's what Bidi ought
to do for him/her); in other words, unless the person is whacked-out and
doesn't know that Fvwm has Bidi support he should not bend backwards in an
attempt to simply display his/her glyphs (in short, example 2 above should
not be something you should worry about).  When the person types his title
in a bidi editor, the characters will still be stored in logical order
(having Bidi support simply means you have visual support, there is no funny
business taking place on disk -- there is no storage manipulation).

>From what I understand, having Bidi enabled at all times should/will not
alter current display of latin characters.  In other words, let's assume
you've setup fvwm to display menu/title/pager/etc with English/French
characters, if you then opt to enable Bidi (in this instance the fribidi
library), then all your fribidi output will amount to be exactly the same
as the input - ie. you will not see a change.  If, on the other hand, you
had a title string "english, french, ARABIC" then you make a call to fribidi,
it will return "english, french, CIBARA" (reversing the Arabic - which is
what you'd want).  I don't see why the locale is relevant - I can type-in
my menu titles and xterm titles in .fvwmrc using a bidi editor and invoke
fvwm irrespective of locale and should be able to see correct rendering of
the titles, reversed and everything (like they where when I entered them in
the Bidi editor).

If I missed any parts or if its still confusing, doesn't hesitate to let
me know.

 - Nadim

__________________________________________________
Do You Yahoo!?
Yahoo! Sports - sign up for Fantasy Baseball
http://sports.yahoo.com
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Olivier Chapuis <[email-masked]>
Date: Sun, 3 Mar 2002 14:31:08 +0100

> the titles, reversed and everything (like they where when I entered them in

The locale is relevant I think but not directly what is really relevant
is the font charset. fvwm has to know if your config files is written
using UTF-8 encoding or ISO-8859-{6,8} or an LRT encoding.
In other word, when fvwm have a string to display it cannot discover,
by just examining the string, which encoding is used (or more precisely
I do not know if this is possible and I do not think so). Moreover,
fvwm use the X font that the user specify to display text so what
we need is to use the font charset to decide if we need to use
the fribidi filter (which is more or less the locale charset with
multibyte support). For example, if we have the string "english, french,
ARABIC" for a menu title and the Menu font is an ISO-8859-1 font the
displayed string should be "english, french, ARABIC" as if the Menu font
is an (imaginary) capRTL font it should be "english, french, CIBARA".

Olivier