Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-21999

FTETextField htmlText not consistent with Player TextField

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • Adobe Flex SDK Previous
    • None
    • Spark: FTETextField
    • None
    • Affected OS(s): All OS Platforms
      Language Found: English

    Description

      Found in 4.0.0.11707

      Steps to reproduce:
      1. Compile and run attached MXML file.

      Actual Results:
      The Player TextField class' htmlText property returns additional HTML markup such as <font> tags with face, size, color, letterspacing, and kerning attributes.
      The FTETextField class' htmlText property simply returns whatever was passsed into it.

      The TLF TextConverter returns full markup such as <HTML>, <BODY>, <FONT> and other tags.

      Expected Results:
      The FTETextField should return the markup from the TextConverter (I think)

      Workaround (if any):
      n/a


      <?xml version="1.0" encoding="utf-8"?>
      <!-- -theme+=${flexlib}/projects/spark/MXFTEText.css -->
      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
      xmlns:s="library://ns.adobe.com/flex/spark"
      xmlns:mx="library://ns.adobe.com/flex/halo"
      creationComplete="setHTMLStuff();">

      <fx:Script>
      <![CDATA[
      import flashx.textLayout.conversion.ConversionType;
      import flashx.textLayout.conversion.TextConverter;
      import flashx.textLayout.elements.TextFlow;

      import mx.core.FTETextField;

      private const txt:String = "<p>paragraph</p> <p><b>bold</b></p>";

      private function setHTMLStuff():void

      { var tf:TextField = new TextField(); tf.htmlText = txt; tf.border = true; c1.height = tf.height; c1.rawChildren.addChild(tf); var fte:FTETextField = new FTETextField(); fte.htmlText = txt; fte.border = true; c2.height = fte.height; c2.rawChildren.addChild(fte); debug.appendText("TextField.htmlText:\n" + tf.htmlText + "\n\n"); debug.appendText("FTETextField.htmlText:\n" + fte.htmlText + "\n\n"); debug.appendText("TextConverter output:\n" + converto(txt)); }

      private function converto(value:String):String

      { var flo:TextFlow = TextConverter.importToFlow(value, TextConverter.TEXT_FIELD_HTML_FORMAT); var out:String = TextConverter.export(flo, TextConverter.TEXT_FIELD_HTML_FORMAT, ConversionType.STRING_TYPE).toString(); return out; }

      ]]
      >
      </fx:Script>

      <mx:VBox id="gr">
      <mx:Canvas id="c1" />
      <mx:Canvas id="c2" />
      <mx:Canvas id="c3" />
      <s:TextArea id="debug" width="400" height="300" />
      </mx:VBox>

      </s:Application>

      Attachments

        Activity

          People

            adobejira Adobe JIRA
            adobejira Adobe JIRA
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: