Fourth World Logo Fourth World Media Corporation
  Embassy Services Products Resources   About Fourth World Contact  


IncWell Logo

SuperCard FAQ

4W Logo

How do I change the font attributes for a text chunk?


SuperCard 3.0 allows the use of chunk expressions to get and set text attributes. For example:

get the textStyle of word 3 of field 1
if it is "bold" then
set the textStyle of word 3 of fld 1 to "bold,italic"
end if


For earlier version of SuperCard, the program only allows you to set font attributes by first selecting the desired range of text, and then setting the text attributes of the field, which will affect only the selection.

For example, to change the third word to Palatino bold, you could script:

on SetThirdWord
select word 3 of cd fld "TestField"
set the textFont of cd fld "TestField" to Palatino
set the textStyle of cd fld "TestField" to bold
end SetThirdWord