Set Text Size is empty but then not empty

Sivakatirswami katir at hindu.org
Sat Jan 7 23:22:57 EST 2006


I should add that mysteriously some other newly created fields where  
I entered text, but  never once selected and set the textsize of the  
text manually *do* obey my script. i.e i appears the Textsize (and  
textFont) of these fields and the text in them are *truly* empty..

So then the question could be rephrased:

Once having selected text in a fld and manuall yset a font size of  
text font. .. how can then one subsequently clear those values  
(setting them to empty with a button is not working) so that they are  
*really, really* empty and will then revert to "inherit" mode and can  
be changed under script control. such that "set the textsize of fld  
fooDa to 12" will cause the text in the field to change size.

On Jan 07, 2006, at 6:16 PM, Sivakatirswami wrote:

> 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
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>




More information about the use-livecode mailing list