Package | ardisia.components.autoFitText |
Class | public class AutoFitRichText |
Inheritance | AutoFitRichText spark.components.RichText |
Slower than the AutoFitLabel and the AutoFitFTETextField but supports TLF and does a better job of not word wrapping intra-word because it supports the "breakOpportunity" style.
View the technical documentation on the Ardisia Labs website for more information.
DESIGN NOTES
Scaling will not work because the entire component will scale, not just the text.
Default MXML Propertycontent
Property | Defined By | ||
---|---|---|---|
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. | AutoFitRichText | ||
maxFontSize : Number
The maximum allowed fontSize. | AutoFitRichText | ||
minFontSize : Number
The minimum allowed fontSize. | AutoFitRichText | ||
precisionThreshold : Number
The font size precision used by the class to determine when the fit is
'good enough', in pixels. | AutoFitRichText |
Method | Defined By | ||
---|---|---|---|
AutoFitRichText | |||
dispose():void
Call to remove the component from the display list and remove any
event listeners. | AutoFitRichText | ||
fitText():void
Will set the label fontSize to fill the available space without
truncation. | AutoFitRichText |
Method | Defined By | ||
---|---|---|---|
calculateWordCount():void
Determines the number of words in the "text" property string. | AutoFitRichText | ||
eventHandler(event:Event):void
Handles events on the control. | AutoFitRichText | ||
getNumLines():Number
Returns the number of text lines. | AutoFitRichText |
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 60
.
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
AutoFitRichText | () | Constructor |
public function AutoFitRichText()
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.
dispose | () | method |
public function dispose():void
Call to remove the component from the display list and remove any event listeners.
eventHandler | () | method |
protected function eventHandler(event:Event):void
Handles events on the control.
Parameters
event:Event — the Event that triggered the handler
|
fitText | () | method |
public function fitText():void
Will set the label fontSize to fill the available space without truncation.
getNumLines | () | method |
protected function getNumLines():Number
Returns the number of text lines.
ReturnsNumber — int of the number of lines
|