Expand my Community achievements bar.

Change Text Size

Avatar

Level 2

I have an Array and need to change the size of the text on one of the selections.

The textfield size font is 10 and is ok for a short word but I need a different size for one of the words in the list.

//Array for °Brix

var addBrix = new Array (" ",

                                     "Brix1",

                                     "Brix2",

                                     "Brix / Sugar");   I need to make the size of the text smaller here. 

Thank You.

1 Reply

Avatar

Level 10

You could try an "automatic font resizing by selecting the textfield and setting its font size to 0pt. At runtime the font starts out as 12pt, but automatically reduces as the string length increases. See an example on page 3 of this form: http://assure.ly/g80MVY.

Another option would be to test the length of the string and then change the font size:

if (this.rawValue.length > 5) {

     this.font.size = "8pt";

}

else {

     this.font.size = "10pt";

}

Niall