Re: HTML font size in percentages

2022-05-25 Thread J. Landman Gay via use-livecode

On 5/25/22 6:36 AM, Paul Dupuis via use-livecode wrote:
Anyway, here is the routine, While it works, if I was rewriting it, I would probably just do a 
loop with a match to the html font size attribute. This code does ensure that the size can't go 
below a minimum where LC's legacy font size values actually make the text bigger.


Thanks so much, very helpful. It's close to what I was thinking of doing. The other alternative 
is looping through style runs in the styledText property. The text I'm dealing with is pretty 
long, so I'll do some tests to see which method is faster.


Thanks again,

Jacque

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
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: HTML font size in percentages

2022-05-25 Thread Paul Dupuis via use-livecode

On 5/20/2022 4:30 PM, J. Landman Gay via use-livecode wrote:
Thanks for verifying it Paul, that's what I was thinking too. I'm 
looking at replacing the sizes via the style runs, I have a handler 
Mark Waddingham gave me/us on the list last year that I think I can 
modify.


But I'd be grateful to see yours too. No big hurry, I just need to get 
an idea of how to estimate my time at this point. Thank you very much.





Sorry for the delay. By some weird email glitch I only saw this list 
post today.


Anyway, here is the routine, While it works, if I was rewriting it, I 
would probably just do a loop with a match to the html font size 
attribute. This code does ensure that the size can't go below a minimum 
where LC's legacy font size values actually make the text bigger.


on ChangeTextSize pBiggerOrSmaller, pObj
  -- usage: ChangeTextSize "bigger"|"smaller",the long ID of field X of 
stack Y

  lock screen
  if len(the text of pObj) > 5000 then
    set cursor to watch
  end if

  -- Get current scaling. The textSize will be set to the effectove 
textSize + tCurScale (+1|-1)

  -- uTextScaling is defauted to 0 in the object (field) custom properties
  put the uTextScaling of pObj into tScale
  if tScale is empty then put 0 into tScale
  if pBiggerOrSmaller is "bigger" then
    add 1 to tScale
    put 1 into tCurScale
  else
    subtract 1 from tScale
    put -1 into tCurScale
  end if
  set the uTextScaling of pObj to tScale
  --
  put the htmlText of pObj into tHtml
  --
  set the textHeight of pObj to empty
  set the textSize   of pObj to max(8,the effective textSize of 
pObj+tCurScale)

  --
  replace "size=" with "size="(1500) in tHtml
  set the itemdel to numToChar(1500)
  if the number of items of tHtml <> 1 then
    put 0 into testItem
    repeat for each item theItem in tHtml
  add 1 to testItem
  if testItem<>1 then
    put offset(quote,theitem) into counter
    put char 1 to counter-1 of theItem into theSize
    put max(8,theSize+tCurScale) into theSize
    put theSize into char 1 to counter-1 of theItem
    put quote after newHTML
  else
    put theItem into newHTML
    next repeat
  end if
    end repeat
    set the htmlText of pObj to newHTML
    --
  end if
  unlock screen
end ChangeTextSize

___
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: HTML font size in percentages

2022-05-20 Thread J. Landman Gay via use-livecode
Thanks for verifying it Paul, that's what I was thinking too. I'm looking at replacing the 
sizes via the style runs, I have a handler Mark Waddingham gave me/us on the list last year 
that I think I can modify.


But I'd be grateful to see yours too. No big hurry, I just need to get an idea of how to 
estimate my time at this point. Thank you very much.



On 5/20/22 2:08 PM, Paul Dupuis via use-livecode wrote:

You have to do replacement of the size value in the field's htmlText (or 
perhaps styledText)

I have code that does this. I can provide it to you if you like. I don't claim it is the bets 
or most effiecent. Unfortunately, I am gone for the rest of today, s tomorrow is the earliest I 
could send code to you.




On 5/20/2022 12:32 PM, J. Landman Gay via use-livecode wrote:
I have a field whose HTMLtext is set to a heavily tagged HTML file that changes the font size 
repeatedly. We want to allow the user to adjust the size of the text. The easiest way would 
be to use percentages for the font sizes so that changing the field's textsize would change 
the markup proportionally, but LC fields don't seem to support that. Is there a trick or do I 
need to do a series of replacements? I'm afraid that will be too slow, there's a lot of text.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com




--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
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: HTML font size in percentages

2022-05-20 Thread J. Landman Gay via use-livecode

On 5/20/22 11:45 AM, Devin Asay via use-livecode wrote:

It sounds like the HTML tags are setting the size for runs of text in the 
field, so you can’t just set the textSize of the field?


I did try setting the text size of the field, and all untagged chunks reflect the new size as 
expected (default field text is 20 points.) But there are exceptions embedded in the text that 
require superscripts and/or other sizes for chapter headings and other things. It looks like this:


TEXT HERE shift="-6">TEXT HERETEXT HERETEXT 
HERETEXT HERE, ETC ETC


The text is too long for a single field so I'm using Trevor's dataView (thank you so much 
Trevor!) The text sizes and superscripts are footnotes, references, and other supplementary 
info. They are scattered liberally around in the text.


Untagged text responds well to the field text size, which I can easily change in the dataView 
template. But the superscripts text size and offset, and other changes do not because they are 
specifically indicated with integers. If I could use percentages, then changing the field text 
size would proportionally change everything else. But percentages don't work in my tests.


I wish we could use CSS in LC fields, but it isn't supported. I can't use any type of browser 
because we need features that a browser doesn't support.




Are there varying sizes of text runs in the field? Could you set the textSize 
of the char 1 to -1 of the field to empty, then set it for the whole field? In 
one project I’ve implemented a feature similar to what Bob was talking about 
where I increment the textSize of the field by 1 point using Cmd/Cntl + or -.


This is a mobile app, so no keyboard is available. It's been in the app stores for about a year 
but our main complaint from users is that the text is too small on a phone. We'd like to fix 
that. The choice of font size would be a setting in user prefs and the text would accomodate 
that whenever the app runs.



--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com
___
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: HTML font size in percentages

2022-05-20 Thread Paul Dupuis via use-livecode
You have to do replacement of the size value in the field's htmlText (or 
perhaps styledText)


I have code that does this. I can provide it to you if you like. I don't 
claim it is the bets or most effiecent. Unfortunately, I am gone for the 
rest of today, s tomorrow is the earliest I could send code to you.




On 5/20/2022 12:32 PM, J. Landman Gay via use-livecode wrote:
I have a field whose HTMLtext is set to a heavily tagged HTML file 
that changes the font size repeatedly. We want to allow the user to 
adjust the size of the text. The easiest way would be to use 
percentages for the font sizes so that changing the field's textsize 
would change the markup proportionally, but LC fields don't seem to 
support that. Is there a trick or do I need to do a series of 
replacements? I'm afraid that will be too slow, there's a lot of text.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com



___
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: HTML font size in percentages

2022-05-20 Thread J. Landman Gay via use-livecode
The text has to be in a field for lots of reasons. Browsers and widgets are 
too limited.

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
On May 20, 2022 11:40:12 AM Bob Sneidar via use-livecode 
 wrote:


I know that typically cmd +/- (or ctrl for Win) will increase or decrease 
the zoom of a web page. You can try that, or else use a browser widget. (I 
wonder if that trick would work in a widget?? It should...)


Bob S


On May 20, 2022, at 09:32 , J. Landman Gay via use-livecode 
 wrote:


I have a field whose HTMLtext is set to a heavily tagged HTML file that 
changes the font size repeatedly. We want to allow the user to adjust the 
size of the text. The easiest way would be to use percentages for the font 
sizes so that changing the field's textsize would change the markup 
proportionally, but LC fields don't seem to support that. Is there a trick 
or do I need to do a series of replacements? I'm afraid that will be too 
slow, there's a lot of text.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com



___
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: HTML font size in percentages

2022-05-20 Thread Keith Clarke via use-livecode
Hi Jaque,
A lot will depend:
1) Whether the changes in font size within the nested HTML tags have been set 
locally or ‘more properly' as relative to the root font size of the page in 
‘rem’, where 1 rem = 100% of the root font-size).
2) you want a global font-size adjustment or more granular.

If you can set CSS in the page (via the browser widget of by inserting text 
into the HTML), you could try experimenting with setting the body or other 
outermost element font-size to 5rem to see if that affected sizing throughout?

For example, if the page it has a body tag, you could insert the following 
style block into the HTML header tag.


body {font-size: 5rem;}

  
Best,
Keith

> On 20 May 2022, at 17:32, J. Landman Gay via use-livecode 
>  wrote:
> 
> I have a field whose HTMLtext is set to a heavily tagged HTML file that 
> changes the font size repeatedly. We want to allow the user to adjust the 
> size of the text. The easiest way would be to use percentages for the font 
> sizes so that changing the field's textsize would change the markup 
> proportionally, but LC fields don't seem to support that. Is there a trick or 
> do I need to do a series of replacements? I'm afraid that will be too slow, 
> there's a lot of text.
> 
> --
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software | http://www.hyperactivesw.com
> 
> 
> 
> ___
> 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: HTML font size in percentages

2022-05-20 Thread Devin Asay via use-livecode
Jacque,

It sounds like the HTML tags are setting the size for runs of text in the 
field, so you can’t just set the textSize of the field?

Are there varying sizes of text runs in the field? Could you set the textSize 
of the char 1 to -1 of the field to empty, then set it for the whole field? In 
one project I’ve implemented a feature similar to what Bob was talking about 
where I increment the textSize of the field by 1 point using Cmd/Cntl + or -.

- Devin


On May 20, 2022, at 10:32 AM, J. Landman Gay via use-livecode 
mailto:use-livecode@lists.runrev.com>> wrote:

I have a field whose HTMLtext is set to a heavily tagged HTML file that changes 
the font size repeatedly. We want to allow the user to adjust the size of the 
text. The easiest way would be to use percentages for the font sizes so that 
changing the field's textsize would change the markup proportionally, but LC 
fields don't seem to support that. Is there a trick or do I need to do a series 
of replacements? I'm afraid that will be too slow, there's a lot of text.

--
Jacqueline Landman Gay | 
jac...@hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com



___
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

Devin Asay
Office of Digital Humanities
Brigham Young University

___
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: HTML font size in percentages

2022-05-20 Thread Bob Sneidar via use-livecode
I know that typically cmd +/- (or ctrl for Win) will increase or decrease the 
zoom of a web page. You can try that, or else use a browser widget. (I wonder 
if that trick would work in a widget?? It should...)

Bob S


> On May 20, 2022, at 09:32 , J. Landman Gay via use-livecode 
>  wrote:
> 
> I have a field whose HTMLtext is set to a heavily tagged HTML file that 
> changes the font size repeatedly. We want to allow the user to adjust the 
> size of the text. The easiest way would be to use percentages for the font 
> sizes so that changing the field's textsize would change the markup 
> proportionally, but LC fields don't seem to support that. Is there a trick or 
> do I need to do a series of replacements? I'm afraid that will be too slow, 
> there's a lot of text.
> 
> --
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software | http://www.hyperactivesw.com
> 
> 
> 
> ___
> 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


HTML font size in percentages

2022-05-20 Thread J. Landman Gay via use-livecode
I have a field whose HTMLtext is set to a heavily tagged HTML file that 
changes the font size repeatedly. We want to allow the user to adjust the 
size of the text. The easiest way would be to use percentages for the font 
sizes so that changing the field's textsize would change the markup 
proportionally, but LC fields don't seem to support that. Is there a trick 
or do I need to do a series of replacements? I'm afraid that will be too 
slow, there's a lot of text.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com



___
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