• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Nested Span in TLF!

Guest
Apr 27, 2010 Apr 27, 2010

Copy link to clipboard

Copied

Hi folks...

There is problem here:

I have something like this in my RichEditableText's textFlow:


str = "<TextFlow xmlns='http://ns.adobe.com/textLayout/2008'>"+"<div><tab/>" +
      "<span fontFamily='tahoma' fontSize='12' color='0xc08057'>text specific word text</span></div>"+

      "</TextFlow>";
RichEditableText.textFlow=TextConverter.importToFlow(str, TextConverter.TEXT_LAYOUT_FORMAT);


I want to use replace() func, just like this:


var myPattern:RegExp = new RegExp(TextInput.text,"gi")
str = str.replace(myPattern,"<span backgroundColor='#c17e56' color='#dec59d'>"+TextInput.text+"</span>");                    
RichEditableText.textFlow= TextConverter.importToFlow(str, TextConverter.TEXT_LAYOUT_FORMAT);


But after doing this, my specific word that I had been written in my TextInput, would'nt be appear inside of my text. I think because of another <span> in the main text. the result is something like this:


<span fontFamily='tahoma' fontSize='12' color='0xc08057'>
     text <span backgroundColor='#c17e56' color='#dec59d'>specific word</span> text
</span>


how can I fix this?!

TOPICS
Text layout framework

Views

1.4K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Apr 27, 2010 Apr 27, 2010

Copy link to clipboard

Copied

The problem is that a TLF span doesn't map to an HTML span which does support nesting.  What's needed is

a new element - "SubParagraphGroupElement" that can have text, tlf type spans and other SubParagraphGroups as children.

One awful hack would be to turn all the outer span's into tcy's which will have no effect unless you are doing vertical text.  That gives you exactly one level of nesting - probably worse than useless.  Anyhow it would look like this:

   <p>
   <tcy fontFamily='tahoma' fontSize='12' color='0xc08057'>
        text <span backgroundColor='#c17e56' color='#dec59d'>specific word</span> text
   </tcy>
   </p>

The more people that agitate for a SubParagraphGroupElement the better.  It's a hard sell and keeps falling off the plans.

Richard

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 28, 2010 Apr 28, 2010

Copy link to clipboard

Copied

TanQ for ur reply dear richard,

I tested that, but there is an other problem.

I could use textAlign='justify' in my <span />, but in <tcy /> seems that it doesn't work!

how can I do that?!


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Apr 29, 2010 Apr 29, 2010

Copy link to clipboard

Copied

LATEST

textAlign has no effect when applied to a SpanElement.  textAlign only has effect on the ParagraphElement.  Must be something else going on with your code.

Richard

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines