How to increase the textsize of HTMLtext proportional?

Michael Doub mikedoub at gmail.com
Wed Jul 10 17:00:22 EDT 2013


Thanks to Malte for his initial work.  I just tweaked.

-= Mike


On Jul 10, 2013, at 8:10 AM, Tiemo Hollmann TB <toolbook at kestner.de> wrote:

> Thanks Michael!
> Your code works perfect!
> Tiemo
> 
> 
>> -----Ursprüngliche Nachricht-----
>> Von: use-livecode [mailto:use-livecode-bounces at lists.runrev.com] Im
> Auftrag
>> von Michael Doub
>> Gesendet: Dienstag, 9. Juli 2013 22:09
>> An: How to use LiveCode
>> Betreff: Re: How to increase the textsize of HTMLtext proportional?
>> 
>> A bit more suitable for easy reuse.....
>> 
>> 
>> on textdown
>>    BumpText the long id of field "test", -1 end textdown
>> 
>> on textup
>>    BumpText the long id of field "test", 1 end textup
>> 
>> 
>> on BumpText theObject theDirection
>>    if theDirection is not among the lines of "1" & return & "-1" then
>> throw "Need 1 or -1 for theDirection"
>>    put the htmlText of fld 1 into theHtml
>>    replace "size="&quote with "size="&numtoChar(1500) in theHTML
>>    set the itemdel to numToChar(1500)
>>    if the number of items of theHTML<>1 then
>>       put 0 into itemCount
>>       repeat for each item theItem in theHTML
>>          add 1 to itemCount
>>          if itemCount=1 then
>>             put theItem into newHTML
>>             next repeat
>>          end if
>>          put 1 into counter
>>          put offset (">", theItem) into tClose
>>          put offset ("<" , theItem) into tOpen
>>          if tClose <> 0 then -- found it
>>             if tOpen <> 0 and tOpen > tClose then-- found "<" and after
>> ">" whis is ok
>>                repeat forever
>>                   add 1 to counter
>>                   if char counter of theItem=quote then exit repeat
>>                end repeat
>>                put char 1 to counter-1 of theItem into theSize
>>                put theSize + theDirection into theSize
>>                put theSize into char 1 to counter-1 of theItem
>>             end if
>>          end if
>>          put quote&theItem after newHTML
>>       end repeat
>>       set the htmlText of theObject to newHTML
>>    end if
>>    set the textSize of theObject to \
>>          the effective textSize of theObject + theDirection end BumpText
>> 
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list