Skip to main content
Inspiring
February 23, 2009
Answered

Howto use FormatValue.INHERIT

  • February 23, 2009
  • 6 replies
  • 900 views
In previous TLF builds, if I wanted my entire TextFlow to have a left margin of 30, all I needed to do was to set the textFlow.marginLeft=30 of in my markup for import have my TextFlow node include the string marginLeft="30"

Now, marginLeft is no longer a style that is inherited. However, there is a hint that if you use FormatValue.INHERIT "somewhere" then you can make the style inheritable, such that I dont have to go through each and every node of my text flow and add set the style specifically.

Can you please tell me how/where I should do this?
Thanks,
This topic has been closed for replies.
Correct answer rdermer
TLF only pays attention to margins at the paragraph level. That's in the grey area of a bug/unimplemented feature. Consider using TextFlow.paddingLeft insead of marginLeft. That does get applied.

6 replies

Adobe Employee
February 24, 2009
Exactly. It should put a margin around the entire document - not around each paragraph in the document. However currently the margin property for TextFlow is not supported.
tpf70Author
Inspiring
February 24, 2009
I guess I just see margins as something that applies to an entire document as opposed to each individual element. When I create a word processing document, I create a margin for the document. When I want to indent a paragraph, then I would apply a specific setting to that paragraph, but if I dont do anything, I still get the outer margin of the document. Based on the way things are working, I dont set a margin on the entire page, I set padding.
Adobe Employee
February 24, 2009
TextFlow.marginLeft means a marign on the left side of the TextFlow. The margin settings on a div are the margins around the div. Neither is meant to be the margin around the individual paragraphs.

The goal isn't to require formatting but to make a margins model that works at all the appropriate levels. Having the margins inherit down to the paragraph would mean that a) you expect that TextFlow, div and paragraphs all have the same margins and b) expect them to be mutiply applied.

So there are two possible solutions:
1) paragraphMargin properties that do inherit by default. I suppose they'll combine with margin properties on the paragraph.
2) use CSS. Our importer doesn't support it but the model does.
tpf70Author
Inspiring
February 23, 2009
I would like to make a formal request that you reconsider this functional change.

It is not always possible to inject formatting into all of the paragraphs that are going to be composed in an application. Much of the content can come from external sources, and is simply injected into a text stream to import via the TextFilter.

If the requirement to modify the incoming text to simply use defaults exists, that makes the job of aggregating information much more difficult, time consuming and processor intense.

I would think that to inherit should be the default and to override would be the exception.

Can you please provide some insight as to why you are looking at it in the reverse priority?
Thanks,
Tim
Adobe Employee
February 23, 2009
The composer computes an effective padding combining the container's padding with the textFlow's padding. How the attributes propogate via inheritance is not the same as how they are actually applied.

Regarding your -- example that won't work. What you really want is for all the ParagraphElement's to have a marginLeft of "inherit". Then you'll get the same result. However, long term the actual margin will be a combination of the TextFlow's margin and the pargraph's margin.
rdermerCorrect answer
Adobe Employee
February 23, 2009
TLF only pays attention to margins at the paragraph level. That's in the grey area of a bug/unimplemented feature. Consider using TextFlow.paddingLeft insead of marginLeft. That does get applied.
tpf70Author
Inspiring
February 23, 2009
Thanks Rich.

2 Items:

1.) paddingLeft does seem to do the trick, although I am confused a bit. I thought paddingLeft was also not inherited, yet it does trickle all the way through my text flow????

2.) As an aside, I tried the code below just prior to seeing your reply, and unfortunately it didnt work(maybe because of the bug you indicate). Still, is this the right track for using the inherit???

Thanks,
tim