Editing the style(s) of text in a field.

Alex Tweedly alex at tweedly.net
Wed Feb 26 17:50:18 EST 2014


I'm writing some scripts to allow me to edit the style of text in a 
field, and looking for advice / suggestions on what the script *should* do.

(I might be back later to ask *how* can I do ... those things I should 
do :-)

If I select a chunk of the field, and click on the "Bold" button then

I assume that

  - if the chunk is currently 'bold' then it should become 'plain'
        (or more precisely, the textStyle["bold"] of the chunk should 
change from true to false)
  - if the chunk is currently 'plain' then it should become 'bold'
              (or more precisely, the textStyle["bold"] of the chunk 
should change from false to true)

But the question is
   - if the chunk is currently 'mixed', then which of the following 
should happen ?

1. n/a. The button should be disabled in that context

2. no change. Acton didn't make sense.

3. the chunk should become 'bold'   (for compatability with Open Office 
amongst others)

4. each char of the chunk should 'flip' boldness (i.e. equivalent to 
selecting each sub-chunk in turn, and then clicking the bold button)

5, something else.

And a similar question - if the button clicked is the "make the text 
bigger" button, and the text is currently mixed sizes, then should it

0. There shouldn't be a "bigger" button, there should only be fixed size 
settings (see, for example, OO)

1. n/a the "bigger" button should be disabled in that context

2. no change. Acton didn't make sense.

3. the chunk should become 'bigger' than the first character of the chunk
3a. the chunk should become bigger than the average character  (and is 
that average == "mean" or "mode" or ...)

4. each char of the chunk should increase in size (i.e. equivalent to 
selecting each sub-chunk in turn, and then clicking the 'bigger' button)

5, something else.

Thanks for any suggestions
-- Alex.




More information about the use-livecode mailing list