ambassador at fourthworld.com
Mon Mar 28 01:21:03 CST 2005
Ken Ray wrote:
> On 3/27/05 6:31 PM, "Richard Gaskin" <ambassador at fourthworld.com> wrote:
>>I've had a request to do this in one of my Rev-based apps, but it's not
>>so easy: adjusting the size of the field will not affect any styled
>>text within it, requiring some means of adjusting things by character or
>>More efficient than walking through characters would be to manipulate
>>the htmlText of the field, since in most cases the number of <font> tags
>>should be fewer than the number of characters.
> Actually, you can do it this way (YMMV):
> put 18 into tSize -- or whatever size you want
> put the htmlText of fld 1 into tData
> put char 4 to -5 of tData into tData -- strips <p> ... </p>
> put "<font size=" & q(tSize) & ">" & tData & "</font>" into tNewText
> set the htmlText of fld 1 to tNewText
> set the textSize of fld 1 to tSize
>>Is it worth requesting a new language feature to have the engine do
>>this? If so, what syntax do you feel would be appropriate?
> I think this should still be a new language feature, though. Perhaps the
> "effective size"? So we could say:
> set the effective size of fld 1 to 18
> and all text would go to 18, regardless of styling?
I forgot to clarify: by "styled text" I meant all style attributes,
So the challenge is to bump up all sizes by about 10% or so.
Got a regex one-liner for that?
You usually come up with one for everything else. :)
Fourth World Media Corporation
Rev tools and more: http://www.fourthworld.com/rev
More information about the use-livecode