Package | ardisia.components.autoFitText |
Class | public class AutoFitFTETextField |
Inheritance | AutoFitFTETextField mx.core.FTETextField |
FTETextfield is very fast. Much, much faster than a spark Label, but it does not implement IVisualElement so it can only be added to DisplayObjectContainers (E.G. UIComponent). Also, FTETextfield does not participate in layout, or css, so any changes in size/position/styling need to accomplished manually in the parent layout. Also, the fitText() method must be called manually and the dimensions must be set explicitly.
Therefore, the primary purpose of this class is as a label in an item renderer extending UIComponent when performance is a priority.
View the technical documentation on the Ardisia Labs website for more information.
DESIGN NOTES
Since the FTETextField does not support TLF, intra-word wrapping cannot be stopped via the "breakOpportunity" style. RichText does support the "breakOpportunity" style.
Scaling will not work because the entire component will scale, not just the text.
Initial guessing difficult because of line wrapping.
Property | Defined By | ||
---|---|---|---|
autoSize : String [override] | AutoFitFTETextField | ||
ignoreWordLength : Number
Any words with less than or equal to the number of characters defined by
this property will not be included in the word count. | AutoFitFTETextField | ||
maxFontSize : Number
The maximum allowed fontSize. | AutoFitFTETextField | ||
minFontSize : Number
The minimum allowed fontSize. | AutoFitFTETextField | ||
precisionThreshold : Number
The font size precision used by the class to determine when the fit is
'good enough', in pixels. | AutoFitFTETextField |
Method | Defined By | ||
---|---|---|---|
AutoFitFTETextField | |||
fitText():void
Will set the fontSize to fill the available space without clipping. | AutoFitFTETextField |
Method | Defined By | ||
---|---|---|---|
calculateWordCount():void
Determines the number of words in the "text" property string. | AutoFitFTETextField |
autoSize | property |
autoSize:String
[override] public function get autoSize():String
public function set autoSize(value:String):void
ignoreWordLength | property |
ignoreWordLength:Number
Any words with less than or equal to the number of characters defined by this property will not be included in the word count. This is relevant because the number of line breaks cannot exceed the word count.
The default value is 3
.
public function get ignoreWordLength():Number
public function set ignoreWordLength(value:Number):void
maxFontSize | property |
maxFontSize:Number
The maximum allowed fontSize.
The default value is 6
.
public function get maxFontSize():Number
public function set maxFontSize(value:Number):void
minFontSize | property |
minFontSize:Number
The minimum allowed fontSize.
The default value is 6
.
public function get minFontSize():Number
public function set minFontSize(value:Number):void
precisionThreshold | property |
precisionThreshold:Number
The font size precision used by the class to determine when the fit is 'good enough', in pixels.
Higher values will increase performance but not fit as optimally.
The default value is 2
.
public function get precisionThreshold():Number
public function set precisionThreshold(value:Number):void
AutoFitFTETextField | () | Constructor |
public function AutoFitFTETextField()
calculateWordCount | () | method |
protected function calculateWordCount():void
Determines the number of words in the "text" property string. Ignores any words with a character length less than the "ignoreWordLength" property.
fitText | () | method |
public function fitText():void
Will set the fontSize to fill the available space without clipping.