2 Replies Latest reply on Mar 29, 2011 7:20 AM by narcher68

    TLF Textflow renders linebreaks for Span elements

    narcher68

      Hi,

      I'm using Flex 3.5 with TLF 470 build. I have textflows added as children to MX:canvas objects. These display correctly except <Span> elements are causing linebreaks in the displayed text.

       

      The textflow is passed in XML format in and out of a database e.g.

       

       

      var xml:XML = TextConverter.export(_textFlow, TextConverter.TEXT_LAYOUT_FORMAT, ConversionType.XML_TYPE) as XML

       

       

      It is then imported back (content is a string):

      _textFlow = TextConverter.importToFlow(msg.content, TextConverter.TEXT_LAYOUT_FORMAT);

       

      The actual textflow looks like this:

      <TextFlow columnCount="inherit" columnGap="inherit" columnWidth="inherit" fontFamily="Arial" fontSize="14" lineBreak="inherit" paddingBottom="inherit" paddingLeft="inherit" paddingRight="inherit" paddingTop="inherit" verticalAlign="inherit" whiteSpaceCollapse="preserve" xmlns="http://ns.adobe.com/textLayout/2008">

        <p>

          <span>message</span>

          <span fontWeight="bold">bold text</span>

          <span></span>

        </p>

      </TextFlow>

       

      When it displays the "message" and "bold text" end up on separate lines. If I make a similar paragraph using SpanElements added to a paragraph element and add this using addChildAt to the textflow then this text doesn't display with linebreaks even though it looks the same but the part of the textflow that has been exported and then imported still does.

       

      Any ideas what is going?


      Thanks,

      Nigel