font solution

Charles Hartman charles.hartman at conncoll.edu
Thu Jul 7 22:55:35 EDT 2005


David Epstein (who's having list access problems & wrote me  
separately) suggests the solution copied below, to the problem of  
getting text in a field into "owner" font and style after some lines  
have been put into another font.

It looks cool, and I'm working toward using it. Meanwhile, I've  
discovered the source of my problem. If you set the text style of  
some words in a field to link, bold, etc., and then look at the  
htmlText of the field, you see that after the end-of-link/bold  
marker, Rev is putting in a <font> specification (setting it to  
whatever the effective font is at the time the card is made. Get rid  
of that font tag, and the following text reverts to the _real_  
owner's font even when that changes.

Surely that's not the right behavior Rev should have, is it?

(Hope this makes sense -- written in too much haste.)

========= Epstein Solution ============================

on changeFieldTextProps f,mySize,myFont

   repeat with c = 1 to the number of cards

     put the htmlText of fld f of card c into hold[c]

   end repeat

   set the textSize of fld f to mySize

   set the textFont of fld f to myFont

   repeat with c = 1 to the number of cards

     set the htmlText of fld f of card c to hold[c]

   end repeat

end changeFieldTextProps

======================================


Charles Hartman
Professor of English, Poet in Residence
Connecticut College
charles.hartman at conncoll.edu
*the Scandroid* is at cherry.conncoll.edu/cohar/Programs








More information about the use-livecode mailing list