Skip to main content
January 27, 2011
Answered

CSSFormatResolver issue

  • January 27, 2011
  • 1 reply
  • 556 views

Hi,

I am stuck in a problem using the CSSFormatResolver class.

I have a TLF format data given to me through an XML as a String. Now I first import this string using TextFlowUtil.importFromString and assign it to my TextArea's textFlow. I have some styles also being fetched from the XML, which I first set to the CSSFormatResolver object i.e. formatResolverObj using a formatResolverObj.styleSheet.setStyle having a styleName and an object containing various style properties as parameters.

After that I use the formatResolverObj.styleSheet.parseCSS(styleName) to parse my defined style. Now I assign this formatResolver object to my textArea's textFlow.formatResolver property. In my CSSFormatResolver class, I am only using resolveFormat(target:Object):ITextLayoutFormat method, which returns me the desired format according to the styleName on that particular element.

Now th problem is, earlier I had in my TLF only styleNames by default containing the desired formatting properties like <span stylename="SomeStyleName">.

But now my requirement is that in the TLF document if I have a span having something like : <span stylename="SomeStyleName" fontWeight="bold">, then along with the style properties applied by the styleName, my local formatting also gets implemented. I tried by the default manner, but I couldn't got the desired result.

So is this possible in TLF by default or do I need to make something of my own.

Can anyone please guide me on what should be the proper way to approach the same ?

Thanks

This topic has been closed for replies.
Correct answer rdermer

Yes.  That's a bug. TLF needs to allow CSS styling to be applied after the attributes set on the element.  I won't be able to fix this in TLF 2.0.

This link describes the requirement.

http://www.w3.org/TR/CSS2/cascade.html#preshint

Sorry about that,

Richard

1 reply

rdermerCorrect answer
Adobe Employee
January 27, 2011

Yes.  That's a bug. TLF needs to allow CSS styling to be applied after the attributes set on the element.  I won't be able to fix this in TLF 2.0.

This link describes the requirement.

http://www.w3.org/TR/CSS2/cascade.html#preshint

Sorry about that,

Richard