HTML font size in percentages

J. Landman Gay jacque at hyperactivesw.com
Fri May 20 15:13:22 EDT 2022


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:

<p spaceabove="3"><span metadata="XXX">TEXT HERE</span> <span metadata="YYY"><sup 
shift="-6"><font size="14">TEXT HERE</font></sup>TEXT HERE<sup shift="-6"><font size="14">TEXT 
HERE</font></sup>TEXT 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         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com


More information about the use-livecode mailing list