Setting more than 1 textStyle
martin at materiaprima.fsnet.co.uk
Sat Jan 1 17:04:27 EST 2005
>...but what happens when the user selects
>Italic, and (let us say) 15% of the selected text is Italic? Do you make
>character Italic (in addition to whatever other text-styles whichever
>character might have), do you remove Italic from whichever characters have
> My own first impulse is to go with a "50% rule" -- count the text-styles
>of individual characters, and if more than 50% of the selected text has a
>style, treat it as tho the whole thing has it; otherwise, treat it as tho the
>whole thing doesn't have that style. What do the rest of you think?
Good question, In the past I've implemented the same sort of brute force
fudge as yours.
I just ckecked my old copy of MSWord to see what that does and the
behaviour is quite sensible IMO.
If only some of the characters have the style you are applying, The style
you are applying is applied to all the selected characters, and any other
existing styles are preserved.
If all of the characters have the style you are applying, the style you are
applying is removed from the selected characters, and any other styles are
So if for example some of the characters selected have italic, and your
intention is to remove that while retaining other styling, you can apply
italic twice to achieve that effect.
>From a user perspective I think the straightforwardness of that recommends
it to me.
More information about the Use-livecode