LiveCode 7 and Bi-directional fields

J. Landman Gay jacque at hyperactivesw.com
Sat Mar 15 14:09:09 EDT 2014


On 3/12/14, 12:01 PM, Fraser Gordon wrote:
>
> 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)

That could work. It allows a degree of flexibility. The default "start" 
should be "left" if unspecified so that existing code won't break.


> 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.

I'm going to pass on this one, because I haven't needed to use RTF 
languages in my work yet. If you do decide to change the direction in 
existing code, it could have impact in unexpected ways. Those who have 
implemented RTF would need to chime in here, but I'm thinking that any 
automatic changes will break existing stacks.

>
> 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…

I'm against changing the logical definitions of "left" and "right," 
because keeping track of a shifting definition would be a nightmare. 
Adding new syntax for a new feature is a better approach (verified in my 
mind after watching the "word" discussion evolve.)

My first thoughts are that "left" should always mean "left," and RTF 
languages can be managed by the "start" and "end" syntax. The engine 
would check the start position and calculate text chunking from that.

Another option might be a stack, global, or local direction toggle. Then 
we could do something like this:

   set the languageDirection [of object] to "RTL"
   put <reversed text> after word 4 of line 1 of fld y
   set the languageDirection [of object] to "LTR"

and everything in the field after that would go back to being LTR.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com





More information about the use-livecode mailing list