Subject: Adding Bidi to Fvwm ?

From: Nadim Shaikli <[email-masked]>
Date: Thu, 21 Feb 2002 12:08:45 -0800 (PST)

With the recent work on multibyte support in Fvwm2 - has any thought been
given to those languages that are right-to-left oriented (Arabic, Farsi,
Hebrew, etc...) ?  In other words, have any considerations been given to
the addition of Bidi (Bi-directionality) ?

  http://www.unicode.org/unicode/reports/tr9/

May I suggest a compile-time option of including Fribidi (open source Bidi
library),

  http://fribidi.sourceforge.net

I'd be interested in adding Arabic support to Fvwm but that is very much
hinged on the inclusion of Bidi (its a first-order requirement).  It would
greatly simply life for me (and others I'm sure) if there was an option
to include and enable Bidi without having to resort to hacks.

For what its worth - the inclusion of Bidi will certainly increase Fvwm's
user base, since it would be one of the few window-managers with FULL
multibyte support; a BIG deal to those that are right-to-left'ies :-)

Any takers ? Olivier ;-) ?

Thanks..

BTW: Please CC replies to all noted in header.

 - Nadim

__________________________________________________
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
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: Mikhael Goikhman <[email-masked]>
Date: Thu, 21 Feb 2002 23:02:33 +0000

> Any takers ? Olivier ;-) ?

I don't know whether I will add bidi support, but I may try to start it.
At least I understand what this means. It is not trivial to immediately
understand why this is needed and even less trivial to understand that
it's all heuristics, there may be possible conflicts in any algorithms.
Examples of logical input / visual output.

  % echo "SHALOM, fvwm (SHALOM is hi in IVRIT!)." | fribidi -C CapRTL
                                 .(!IVRIT is hi in MOLAHS) fvwm ,MOLAHS
  % echo "hi 1-2 (english) is SHALOM 1-2 (IVRIT)." | fribidi -C CapRTL
  hi 1-2 (english) is IVRIT) 2-1 MOLAHS).
  # the second example seems like a bug in my fribidi, but maybe not

Actually, bidi is orthogonal to unicode and to aligment, i.e. it may be
applied to a normal 256-symbol charset, and, I think, we may assume it
only affects an order of symbols inside the string, not its alignment.

So, what I may do is to add --with-fribidi-{library,includes}, and try to
figure out where this bidi filter should be added. But I am not sure yet
what exact parameters should be used in all cases (MULTIBYTE or not) and
what are the conditions when bidi should be applied at all.

Regards,
Mikhael.

---

From: Nadim Shaikli <[email-masked]>
Date: Fri, 22 Feb 2002 12:23:48 -0800 (PST)

On Thu, 21 Feb 2002 23:02:33 +0000
 "Mikhael Goikhman" <migo homemail com> wrote:
> > With the recent work on multibyte support in Fvwm2 - has any thought
> > been given to those languages that are right-to-left oriented (Arabic,
> > Farsi, Hebrew, etc...) ?  In other words, have any considerations been
> > given to the addition of Bidi (Bi-directionality) ?
> > 
> > May I suggest a compile-time option of including Fribidi (open source
> > Bidi library),
> > 

My understanding is, the inclusion of Bidi (even if it were enabled at
all times) should not adversely affect latin only characters that are
left-to-right (ie. the status quo).

>   # the second example seems like a bug in my fribidi, but maybe not

I'd agree that your second example should be something the fribidi
people should be informed of on their mailing list.  In passing there
are other Bidi implementations out there,

  http://crl.nmsu.edu/~mleisher/ucdata.html

The point was/is to consider Bidi's inclusion, the various "minor" issues
within ought to be taken care of in other forums.

> what are the conditions when bidi should be applied at all.

As noted above, I'd contend that Bidi's inclusion should not and will not
affect all current external display calls.  In other words, passing in
latin (left-to-right) characters at all times will result in NO change
(ie. output = input).

 - Nadim

---

From: Behdad Esfahbod <[email-masked]>
Date: Sat, 23 Feb 2002 12:39:04 +0330 (IRT)

>   # the second example seems like a bug in my fribidi, but maybe not

This is not a bug in fribidi, but a bug in the Unicode BiDi 
Algorithm, fribidi is just doing its job right.

-- 
Behdad Esfahbod				4 Esfand 1380, 2002 Feb 23 
<behdad at bamdad dot org>		[Finger for Geek Code]

Does a good farmer neglect a crop he has planted?
Does a good teacher overlook even the most humble student?
Does a good father allow a single child to starve?
Does a good programmer refuse to maintain his code?
	-- Geoffrey James, "The Tao of Programming"

---

From: Olivier Chapuis <[email-masked]>
Date: Mon, 25 Feb 2002 00:27:35 +0100

> what are the conditions when bidi should be applied at all.

As you say fribidi works with simple bit charset so I think
that if libfribidi is detected we can try to use it
(HAVE_FRIBIDI).

The main problem to start is to detect the used encoding
of the string we display (window/icon title or menu item).
I suggest to compute the charset at font loading and
to add it to the FlocaleFont structure. Then, depending
of this charset we can apply fribidi filter (that is for
UTF-8(~ ISO10646-1), ISO8859-6 and ISO8859-8 and others?).

I think that first we can forget the alignment problems.
Alignment problems may be solved by adding a "width"
in the FlocaleWinString structure to get a bounding
box. This can be done progressively by using a flag
as FWS_HAVE_WIDTH (used similarly than FWS_HAVE_LENGTH).

Olivier