YUI Flash Component Documentation | All Packages | All Classes | Index | Frames No Frames |
Class TextUtil

Package | com.yahoo.astra.utils
Class | public class TextUtil

Public Methods

| Method | Defined by
--- | --- | ---
|  | getBitmapTextSize(textField:TextField, rotation:Number):Object [static] Returns the dimensions of a text field if rotated. | TextUtil
|  | getTextHeight(textValue:String, tf:TextFormat, rotation:Number = 0):Number [static] Returns the potential height of a string when rendered in a text field. | TextUtil
|  | getTextWidth(textValue:String, tf:TextFormat, rotation:Number = 0):Number [static] Returns the potential width of a string when rendered in a text field. | TextUtil

Method detail

getBitmapTextSize | () | method

`public static function getBitmapTextSize(textField:TextField, rotation:Number):Object`

Returns the dimensions of a text field if rotated.

Parameters

| `textField:TextField` — The text field to be used
| `rotation:Number` — The rotation to be applied

Returns

| `Object`

getTextHeight | () | method |

`public static function getTextHeight(textValue:String, tf:TextFormat, rotation:Number = 0):Number`

Returns the potential height of a string when rendered in a text field. Takes into account the `TextFormat` settings and the rotation.

Parameters

| `textValue:String` — The string that will be used.
| `tf:TextFormat` — The TextFormat object that will be applied.
| `rotation:Number` (default = `0`)`` — The rotation that will be applied

Returns

| `Number`

getTextWidth | () | method |

`public static function getTextWidth(textValue:String, tf:TextFormat, rotation:Number = 0):Number`

Returns the potential width of a string when rendered in a text field. Takes into account the `TextFormat` settings and the rotation.

Parameters

| `textValue:String` — The string that will be used.
| `tf:TextFormat` — The TextFormat object that will be applied.
| `rotation:Number` (default = `0`)`` — The rotation that will be applied

Returns

| `Number`