scripting challenge: Large/Smaller text size

Mark Smith mark at maseurope.net
Sat Jul 2 07:49:32 EDT 2005


But as I just found, on a field with a real lot of text (a field with 
437477 chars), this will be impractically slow....


On 2 Jul 2005, at 12:41, Mark Smith wrote:

> I think you should get the 'effective' textSize of char x in the 
> handler, since if the textSize is inherited from it's owner, which 
> maybe the field, the card, stack or whatever, it's own textSize will 
> be zero....
>
>
> Cheers,
>
> Mark
>
> On 2 Jul 2005, at 11:09, MisterX wrote:
>
>> Richard,
>>
>> Have tried the html way with <font size=+2> by anychance?
>>
>> set the htmltext of fld "text" to "<font size+2>"&the htmltext of fld
>> "text"&"</font>"
>>
>> Nope... that didn't work but it was worth trying ;)
>>
>> and so here's the taoo's script in draft form ;)
>>
>> (sorry, html is just so messy and there's no guarantee of there being 
>> a font
>> size tag anyway... while the field's text does...
>>
>> This function is now added to the editNO2 palette - thanks for the 
>> ideas
>> and a few more variants to come.
>>
>> -- inc is the increment in size (can be negative)
>>
>> on increasetextsize thisfield, inc
>>   put the length of fld thisfield into lengthtext
>>   repeat with x = 1 to lengthText
>>     get the textsize of char x of fld thisfield
>>     set the textsize of char x of fld thisfield to it + inc
>>   end repeat
>>   -- voila
>> end increasetextsize
>>
>> the simpler the script, the easier it is to adapt for other 
>> functions... to
>> other uses like changing colors, lineheight, grids, etc...
>>
>> cheers
>> Xavier
>>
>>
>>> -----Original Message-----
>>> From: use-revolution-bounces at lists.runrev.com
>>> [mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of
>>> Richard Gaskin
>>> Sent: Saturday, July 02, 2005 09:17
>>> To: How to use Revolution
>>> Subject: scripting challenge: Large/Smaller text size
>>>
>>> Mr. Canyon and anyone else who enjoys an iterative
>>> optimization exercise:
>>>
>>> A common feature in apps that display text are
>>> "Larger"/"Smaller" text size options. It seems simple at
>>> first glance, but in practice it's hard to come up with an
>>> especially fast version, given the need to take into account
>>> any variety of varying sizes in the source text.
>>>
>>> If any of you have a script for such a thing, I wonder if the
>>> sort of group review process that was done with the clock
>>> interface would lend itself to optimizing this?
>>>
>>> --
>>>   Richard Gaskin
>>>   Fourth World Media Corporation
>>>   ___________________________________________________________
>>>   Ambassador at FourthWorld.com       http://www.FourthWorld.com
>>> _______________________________________________
>>> use-revolution mailing list
>>> use-revolution at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage
>>> your subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>>
>>
>> _______________________________________________
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your 
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your 
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



More information about the use-livecode mailing list