Set Text Size is empty but then not empty
Sivakatirswami
katir at hindu.org
Sat Jan 7 23:16:41 EST 2006
I have a small stack I am deploying for translation of Tamil and
transliteration.
It has a number of text fields and I would like the user to be able
to change the text size of all the fields, depending on their screen
resolution they will need to either increase or reduce the fonts size
to work.
Problem: Many of these fields are pre-filled with text.
I use this script to attempt to change the font sizes:
A menu button simply passes an integer between 10 and 24 to "tSize"
on setFontSize tSize
put "tamil,exact,edited,flat" into tFlds
repeat for each item da in tFlds
set the textsize of fld da to empty
set the textsize of fld da to tSize
set the textsize of fld (da&"_Title") to tSize
set the textsize of fld (da&"_Line") to tSize
end repeat
end setFontSize
but the font sizes are not changing. The Textheight *does* change and
reflects the new size issued from the menupick but the text in the
field does not change...
Now... if I select the text of the fld and use this from another button:
on mouseUp
set the textsize of the selectedtext to empty
end mouseUp
The text in the field suddenly takes the size value I just set from
the previous attempt. i.e. it immediately inherits the textsize just
previously set for the field... but now, If I try to use the textsize
to change the font again, nothing happens, the text in the fields
retain the font size that it just inherited a few moments ago.
I infer from this and the docs that the textsize of fld and the
textsize of a textChunk in a field are two different "objects" But
is seems unintuitive to me that, once a text chunk (in this case the
selection: the entire text of the field) has it's textsize set to
"empty" that it should then suddenly take on the inherited text size
as its "own" property...
is this a bug? I think the work around would be: set the text of the
fld And the text in it at the same time.
Anyway have any thoughts or insights?
Sivakatirswami
More information about the use-livecode
mailing list