How to increase the textsize of HTMLtext proportional?

2013-07-09 Thread Tiemo Hollmann TB
Hello,

I give the user the option to change the textsize of all fields. No problem
so far by just changing the textsize and adjusting the field size. Now I
have a field with different textsizes in one field. Like bold and bigger
headlines, and standard text, etc.

How would you change the textsize of such a text by keeping the size
relation of the different chunks of text? Should I look up the HTMLtext and
manipulate every "font size attribute" - or is there a more straight forward
approach, I don't see?

Thanks

Tiemo

 

 

 

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: How to increase the textsize of HTMLtext proportional?

2013-07-09 Thread Richard Gaskin

Tiemo Hollmann wrote:

> How would you change the textsize of such a text by keeping the size
> relation of the different chunks of text? Should I look up the
> HTMLtext and manipulate every "font size attribute" - or is there
> a more straight forward approach, I don't see?

I asked this question here a few years back, and there were many good 
solutions presented, with Malte's being the fastest IIRC:


http://lists.runrev.com/pipermail/use-livecode/2005-July/061750.html


--
 Richard Gaskin
 Fourth World
 LiveCode training and consulting: http://www.fourthworld.com
 Webzine for LiveCode developers: http://www.LiveCodeJournal.com
 Follow me on Twitter:  http://twitter.com/FourthWorldSys


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: How to increase the textsize of HTMLtext proportional?

2013-07-09 Thread Mike Bonner
You might look at "styledtext" which returns an array describing all the
text variations in the field. Very handy.


On Tue, Jul 9, 2013 at 7:47 AM, Richard Gaskin
wrote:

> Tiemo Hollmann wrote:
>
> > How would you change the textsize of such a text by keeping the size
> > relation of the different chunks of text? Should I look up the
> > HTMLtext and manipulate every "font size attribute" - or is there
> > a more straight forward approach, I don't see?
>
> I asked this question here a few years back, and there were many good
> solutions presented, with Malte's being the fastest IIRC:
>
> http://lists.runrev.com/**pipermail/use-livecode/2005-**July/061750.html
>
>
> --
>  Richard Gaskin
>  Fourth World
>  LiveCode training and consulting: http://www.fourthworld.com
>  Webzine for LiveCode developers: http://www.LiveCodeJournal.com
>  Follow me on Twitter:  
> http://twitter.com/**FourthWorldSys
>
>
>
> __**_
> use-livecode mailing list
> use-livecode@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: How to increase the textsize of HTMLtext proportional?

2013-07-09 Thread Michael Doub

I was interested in this discussion so I pasted the source of the link below 
into a field and copied the code into a button.   Be careful.   This code does 
not account for the case where the text string "size=" is in the content of the 
html.  In this case the "size=" string is in the  block.

-= Mike

On Jul 9, 2013, at 9:47 AM, Richard Gaskin  wrote:

> 
> I asked this question here a few years back, and there were many good 
> solutions presented, with Malte's being the fastest IIRC:
> 
> http://lists.runrev.com/pipermail/use-livecode/2005-July/061750.html


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: How to increase the textsize of HTMLtext proportional?

2013-07-09 Thread Michael Doub
I think this solves the problem.   You want to make sure that there is a ">" 
but not if it is found after a "<".

on mouseUp
   put the htmlText of fld 1 into theHtml
   replace "size=""e 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 tLeft
 put offset ("<" , theItem) into tRight
 if tLeft <> 0 then -- found it
if tRight <> 0 and tRight > tLeft then-- found "<" and after ">" 
which 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 + 1 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 fld "test" to newHTML
   end if
   set the textSize of fld "test" to \
 the effective textSize of fld "test"+1
end mouseUp


On Jul 9, 2013, at 10:20 AM, Mike Bonner  wrote:

> You might look at "styledtext" which returns an array describing all the
> text variations in the field. Very handy.
> 
> 
> On Tue, Jul 9, 2013 at 7:47 AM, Richard Gaskin
> wrote:
> 
>> Tiemo Hollmann wrote:
>> 
>>> How would you change the textsize of such a text by keeping the size
>>> relation of the different chunks of text? Should I look up the
>>> HTMLtext and manipulate every "font size attribute" - or is there
>>> a more straight forward approach, I don't see?
>> 
>> I asked this question here a few years back, and there were many good
>> solutions presented, with Malte's being the fastest IIRC:
>> 
>> http://lists.runrev.com/**pipermail/use-livecode/2005-**July/061750.html
>> 
>> 
>> --
>> Richard Gaskin
>> Fourth World
>> LiveCode training and consulting: http://www.fourthworld.com
>> Webzine for LiveCode developers: http://www.LiveCodeJournal.com
>> Follow me on Twitter:  
>> http://twitter.com/**FourthWorldSys
>> 
>> 
>> 
>> __**_
>> use-livecode mailing list
>> use-livecode@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@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


AW: How to increase the textsize of HTMLtext proportional?

2013-07-09 Thread Tiemo Hollmann TB
Great thanks Richard, Mike and Michael
Very helpful!
Tiemo

> -Ursprüngliche Nachricht-
> Von: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] Im
Auftrag
> von Michael Doub
> Gesendet: Dienstag, 9. Juli 2013 19:31
> An: How to use LiveCode
> Betreff: Re: How to increase the textsize of HTMLtext proportional?
> 
> I think this solves the problem.   You want to make sure that there is a
> ">" but not if it is found after a "<".
> 
> on mouseUp
>put the htmlText of fld 1 into theHtml
>replace "size=""e 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 tLeft
>  put offset ("<" , theItem) into tRight
>  if tLeft <> 0 then -- found it
> if tRight <> 0 and tRight > tLeft then-- found "<" and after
> ">" which 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 + 1 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 fld "test" to newHTML
>end if
>set the textSize of fld "test" to \
>  the effective textSize of fld "test"+1 end mouseUp
> 
> 
> On Jul 9, 2013, at 10:20 AM, Mike Bonner  wrote:
> 
> > You might look at "styledtext" which returns an array describing all
> > the text variations in the field. Very handy.
> >
> >
> > On Tue, Jul 9, 2013 at 7:47 AM, Richard Gaskin
> > wrote:
> >
> >> Tiemo Hollmann wrote:
> >>
> >>> How would you change the textsize of such a text by keeping the size
> >>> relation of the different chunks of text? Should I look up the
> >>> HTMLtext and manipulate every "font size attribute" - or is there a
> >>> more straight forward approach, I don't see?
> >>
> >> I asked this question here a few years back, and there were many good
> >> solutions presented, with Malte's being the fastest IIRC:
> >>
> >> http://lists.runrev.com/**pipermail/use-livecode/2005-**July/061750.h
> >> tml<http://lists.runrev.com/pipermail/use-livecode/2005-July/061750.h
> >> tml>
> >>
> >>
> >> --
> >> Richard Gaskin
> >> Fourth World
> >> LiveCode training and consulting: http://www.fourthworld.com Webzine
> >> for LiveCode developers: http://www.LiveCodeJournal.com Follow me on
> >> Twitter:
> >> http://twitter.com/**FourthWorldSys<http://twitter.com/FourthWorldSys
> >> >
> >>
> >>
> >>
> >> __**_
> >> use-livecode mailing list
> >> use-livecode@lists.runrev.com
> >> Please visit this url to subscribe, unsubscribe and manage your
> >> subscription preferences:
> >> http://lists.runrev.com/**mailman/listinfo/use-livecode<http://lists.
> >> runrev.com/mailman/listinfo/use-livecode>
> >>
> > ___
> > use-livecode mailing list
> > use-livecode@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@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: How to increase the textsize of HTMLtext proportional?

2013-07-09 Thread Michael Doub
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=""e 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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


AW: How to increase the textsize of HTMLtext proportional?

2013-07-10 Thread Tiemo Hollmann TB
Thanks Michael!
Your code works perfect!
Tiemo


> -Ursprüngliche Nachricht-
> Von: use-livecode [mailto:use-livecode-boun...@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=""e 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@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: How to increase the textsize of HTMLtext proportional?

2013-07-10 Thread Michael Doub
Thanks to Malte for his initial work.  I just tweaked.

-= Mike


On Jul 10, 2013, at 8:10 AM, Tiemo Hollmann TB  wrote:

> Thanks Michael!
> Your code works perfect!
> Tiemo
> 
> 
>> -Ursprüngliche Nachricht-
>> Von: use-livecode [mailto:use-livecode-boun...@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=""e 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@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@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode