larger/smaller fonts

Ken Ray kray at sonsothunder.com
Sun Mar 27 20:22:10 EST 2005


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
> style run.
> 
> 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?


Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com




More information about the use-livecode mailing list