emacs-bidi
[Top][All Lists]
Advanced

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

Re: [emacs-bidi] Display routines


From: Matan Ninio
Subject: Re: [emacs-bidi] Display routines
Date: 07 Nov 2001 12:30:20 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1

Eli Zaretskii <address@hidden> writes:

> On 6 Nov 2001, Matan Ninio wrote:
> 
> > say, you want to write an TCL_TK program that has some Hebrew buttons.
> > your tcl-tk dose not support bidi, and you really don't need it to, as
> > all you want is some static buttons and or texts.
> > you edit the source code, put the Hebrew stuff in strings, and they
> > print just fine with the right font.
> > or you want to write a web page in visual, or whatever.
> > (one needs to remember that some of us are forced to work outside of
> > emacs from time to time.:)
> > 
> > > 
> > > I think he meant pasting from other applications through the clipboard.
> > > And I think this is needed as a special "visual-hebrew-paste" function.
> > 
> > That's the main idea here.  This dose happen.  In many cases, you don't
> > even know if the other application you just marked is logical of
> > visual.
> 
> Btw, what happens on X today?  I'm guessing that, since bidi is not
> really supported, X selections get visual-order strings, is that
> right?
> 
> What about the small number of widgets that do support bidi: do they
> pass text into selections in logical order?
> 
> And what happens on MS-Windows--what order is the text in the
> clipboard?  I'm guessing it's logical; is it?

depending on the application and the coding of the text.  if you start
off with visual, you get visual.  if you start off with logical, you get
logical.
this is a big pain in the * if you cut from one web page to some other
(say, discussion board) and the text is in the wrong order.  I have seen
long messages posted in reverse because of this.

> 
> > if you can read Hebrew postscript, check this address out
> > http://www.cs.huji.ac.il/labs/learning/Info/Ps_Files/lecture2.ps
> > but think of orders pairs of letter.  with SOFIOT in hebrew, this should
> > work very nicely.
> 
> Is something like that possible with Arabic?
yes.  in English as well.  and it's easy to implement.  the algorithm,
once the table of frequencies is set up, looks like this:

loop:
remember last char
move to next char
lookup the value for the pair (last current)
add this value to the score.
if score > threshold1, declare this as visual, exit
if score < threshold2, declare this as logical, exit
else continue

you will need to work in flouting point, but that about all the fuss.

the OTIOT SOFIOT are a dead giveaway, but they are not really needed.
think about English:  you see much more "th" then "ht".
(BTW, some correction needs to be done for spelling errors, in the form
of a Dirichlet prior.)

> 
> > >  > that's it for now, but there probably are many others 
> > > (Word->displayable
> > >  > form??)
> > >  
> > >  You mean, to read Word .doc files?  What's the bidi-specific aspects
> > >  of that?  MS-Word implements UAX#9 (in fact, MS are behind most of
> > >  the mess in the bidi algorithm in its present form ;-), so, after
> > >  conversion from their proprietary format, what you have is
> > >  logical-order text.  Did I miss something?
> > 
> > yah.  they have some internal representation which may, or may not, be
> > Unicode.  I know I'm a tad bit hackerish, but I would want to at least
> >  be able to look into such files with Emacs.
> 
> There's Antiword, for example.  Using it, I had no problem generating
> an iso8859-8 logical-order file from a Word document; you can read
> that in Emacs (backwards).  Of course, you lose all the formatting and
> the markup.
that's probably a better solution, but just opening the file directly
from Emacs is more fun :-))

> 
> _______________________________________________
> emacs-bidi mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/emacs-bidi
> 

-- 
Matan Ninio             
-----------------------------------------
VI VI VI - The Roman Number of The Beast



reply via email to

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