HOw to get htmltext from the field to display in another field

Richard Gaskin ambassador at fourthworld.com
Mon Sep 21 17:13:34 EDT 2020


Sannyasin Brahmanathaswami wrote:

 >  <h1 color="159,59,0">Vedas<br />
 >  A Random Selection<br />
 >  of Sutras</h1>
 >
 > gets turned around. It becomes
 >
 >  <p><b><font size="34">Vedas</font></b></p>
 >  <p><b><font size="34">A Random Selection</font></b></p>
 >  <p><b><font size="34">of Sutras</font></b></p>
 >
 > ?? where does the font size becomes "34" .

HtmlText is not HTML.

It was added to the engine as a convenient way to use HTML-like tagging 
to express field contents with styles.

Header tags (eg "H1") are an HTML convention.  LiveCode has no CSS, and 
hence ability to define header specifiers for size. If you try this:

     set the textSize of fld 1 to "h1"

...it should fail.

But as a convenience or those who may be attempting to mix and match a 
limited form of HTML with LC's HtmlText, the engine will allow header 
tags as input, translating them to fixed values.

As you've discovered there, the fixed value for "H1" is 34.


 > Even with the font size of field increases, it stays at size="34"??

Attributes of field objects are different from attributes of style runs 
in the content within the field object.

Changes to the object's textColor, textSize, and textFont will affect 
the visual rendering of the object's contents only, leaving the contents 
as stored unaffected.

If the content has any attribute set within a style run, that setting 
overrides any setting for the object, much as we see with inheritance of 
visual properties throughout LC.

If you want to change the textSize of the contents of the field, you can 
either:

a) set the textSize of char 1 to -1 of fld "Whatever" to 20

b) set the textSize of char 1 to -1 of fld "Whatever" to empty
    set the textSize of fld "Whatever" to 20


-- 
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  Ambassador at FourthWorld.com                http://www.FourthWorld.com




More information about the use-livecode mailing list