Setting fonts

Ken Ray kray at sonsothunder.com
Thu Jul 7 09:52:10 EDT 2005


> I need to modify what I wrote before, quoted below.
> 
> The text after the special-font (Courier) lines _does_ get set to
> whatever the new default or owner's font is -- UNLESS it (the lines
> without a specified contains any text _style_ changes. A bit in bold,
> or marked as a link, interrupts the transformation, and any text
> after that is in the old, pre-change default font.

That's correct. Inheritance of text attributes is broken as soon as any
style changes. I wish it weren't so, but this is indeed the case.
 
> How should I get around this? I can imagine searching each card,
> putting any special-format text into temporary variables, setting the
> style of everything to Plain, changing the font, then
> reformatting . . . a nightmare. At the moment, nothing better is
> occurring to me.

I have successfully used a frontScript that would trap preOpenCard and then
repeat through all of the fields and set their text attributes to a known
common value, but also checking a custom property of the fields to see if
special handling should occur for a particular field. It works really fast,
and isn't too many lines of code.








More information about the use-livecode mailing list