LiveCode 7 and Bi-directional fields

Devin Asay devin_asay at byu.edu
Mon Mar 17 11:33:08 EDT 2014


On Mar 12, 2014, at 11:01 AM, Fraser Gordon <fraser.gordon at runrev.com> wrote:

> Hi all,
> 
> Due to the many responses we received to our question about adding new chunk types to the LiveCode engine, I thought it might be useful to ask you about another potential change coming in LiveCode 7.0: how fields should handle bi-directional text.
> 
> Currently, fields can be aligned to the left, centre or right and default to the left. This means that any right-to-left (RTL) or bi-directional (BiDi) text entered into the field will always align to the left, rather than to the most natural side for the text being entered. The question that arises is can and should we change this?
> 
> Question 1: should the text alignment options be expanded to include "start" and "end"? (Start means right for RTL and left for LTR while end is the opposite)
> 
> Question 2: if we expand the options, should we interpret "left" and "right" in existing stacks to mean "start" and "end", respectively? This would mean alignment flips when RTL text is entered, making support for RTL text easier. On the other hand, it might be undesirable in some cases.
> 
> Question 3: if we don't add "start" and "end" alignments, should left/right always mean left/right or should they mean the opposite when the field is set up for RTL text? Some office suites and text editors take one approach, others the opposite…
> 
> The fact that existing applications don't all follow the same standard makes it more difficult to decide if any particular approach is the right one. What do you think LiveCode should do?


Fraser,

I put this question to a faculty member here, who is a professor of Arabic and a pretty tech-savvy guy. Back in the day he wrote a whole series of Arabic instructional stacks in HyperCard, and had to code up the Arabic script insertions manually. So he knows all of the tricky issues of handling RTL languages. Here is what he told me:

"
Devin,
Whatever they do it will wreck existing stacks because people would have already made kludgy accomodations to what is there.  I would add the 'start' and 'end' options.  But they need to make sure, with bi-diretional text, that there is a way to control where things like punctuation, quote marks, and parentheses go, since that is the #1 issue.  Many text programs, and html itself, kind of work for right to left text, UNTIL you start adding parentheses and/or punctuation, and then everything falls apart.
"

Like Jacque, I don't feel we should mess with the definition of right and left, but I think there should be a textDirection property of objects (not just fields) and chunks of text in fields. 

I have been told by my RTL language using colleagues that among common Mac applications, TextEdit comes the closest to getting things right.

HTH,

Devin


Devin Asay
Office of Digital Humanities
Brigham Young University





More information about the use-livecode mailing list