Skip to main content
March 17, 2012
Question

Force format resolver to resolve again

  • March 17, 2012
  • 1 reply
  • 3286 views

Hi,

Currently I am using a format resolver to pick up custom user style attributes on paragraph elements and translating them into TextLayoutFormat properties. This is working well, as I am able to perform tasks such as getting properties from external style sheets. For example, ...<p myExternalStyle="someExternalStyle">..., and someExternalStyle, stored externally, would contain properties such as font size, font color, etc.

In the application workflow, sometimes the properties within the external style sheets may change, and, when this happens, I would like to recompose or refresh the text  such that my format resolver gets called again. This would allow the format resolver to reassign updated properties  from the external style sheet, and cause the text properties to be updated. However, I have tried:

textFlow.flowComposer.damage(0, textFlow.textLength, FlowDamageType.INVALID);

followed by either textFlow.flowComposer.compose() or textFlow.flowComposer.updateAllControllers(), but the format resolver is not called again on the text. Is there a way to force or damage the text flow such that a recompse or update would force the format resolvers to get called again?

Thank you for the help.

Will

This topic has been closed for replies.

1 reply

Adobe Employee
March 17, 2012

Only when function "get formatForCascade():ITextLayoutFormat" in class FlowElement is called, you retrieve the custom styles again. So try to get it called in your code.

March 18, 2012

Thank you for your reply.

Isn't get formatForCascade() a TLF internal method?

Adobe Employee
March 18, 2012

I don't mean you just call formatForCascade(). formatForCascade only get the exact "top" format value from all formats that cascade. Then a composition process is also a must to get the textlines refreshed.

You can find which functions will call formatForCascade() in TLF and why formatForCascade is not called or returns a wrong value in your code.