 import flash.geom.Rectangle;
 import flash.geom.Vector3D;
 import flash.system.Capabilities;
+import flash.text.AutoCapitalize;
+import flash.text.ReturnKeyLabel;
 import flash.text.SoftKeyboardType;
 import flash.text.StageText;
 import flash.text.StageTextInitOptions;

        }
    }
    
    mx_internal function calculateInternalPadding(textSize:Point):Point
    {
        // TODO: This shouldn't be necessary once we get an API to determine
        // what a StageText's height should be
        const applicationDPI:Number = FlexGlobals.topLevelApplication.applicationDPI;
        const isAndroid:Boolean = Capabilities.version.indexOf("AND") == 0;
        const isIOS:Boolean = Capabilities.version.indexOf("IOS") == 0;
        
        var verticalPadPerPixel:Number = 0;
        var baseHorizontalPad:Number = 0;
        var baseVerticalPad:Number = 0;
        
        if (isIOS)
        {
            verticalPadPerPixel = 0.0625;
        }
        else if (isAndroid)
        {
            switch (applicationDPI)
            {
                case DPIClassification.DPI_320:
                    verticalPadPerPixel = 0.75;
                    baseHorizontalPad = 7;
                    baseVerticalPad = 15;
                    break;
                case DPIClassification.DPI_240:
                    verticalPadPerPixel = 0.375;
                    baseHorizontalPad = 5;
                    baseVerticalPad = 10;
                    break;
                default:
                    verticalPadPerPixel = 0.125;
                    baseHorizontalPad = 3;
                    baseVerticalPad = 5;
                    break;
            }
        }

        return new Point(baseHorizontalPad, 
            baseVerticalPad + Math.ceil(textSize.y * verticalPadPerPixel));
    }
    
    /**
     *  StageText does not have any provision for measuring text. To get
     *  approximate sizing, this uses a TextField to measure a line of text made
     *  up of an ascender and a descender. Because platform rendering and
     *  TextField rendering differ, the measurement should only be used as an
     *  approximation.
     */
    private function measureTextLineHeight():Number
    {
        var measuringField:TextField = new TextField();
        var format:TextFormat = new TextFormat();
        
        format.font = getStyle("fontFamily");
        format.size = getStyle("fontSize");
        format.bold = getStyle("fontWeight") == "bold";
        format.italic = getStyle("fontStyle") == "italic";
        
        measuringField.text = "Wj";
        measuringField.setTextFormat(format);
        
        var lineMetrics:TextLineMetrics = measuringField.getLineMetrics(0);
        var lineSize:Point = new Point(lineMetrics.width, lineMetrics.height);
        var internalPadding:Point = calculateInternalPadding(lineSize);
        
        return lineSize.y + internalPadding.y;
    }
    
    //--------------------------------------------------------------------------

 *  @playerversion AIR 3.0
 *  @productversion Flex 4.5.2
 */
public class StyleableStageText extends UIComponent implements IEditableText, ISoftKeyboardHintClient
{
    //--------------------------------------------------------------------------
    //
