breakOpportunity across successive spanElements
I'm working on an editing application. I have a couple of questions about how breakOpportunity property is applied to spanElements.
Say I have entered some text like this:
"Which of the diagrams below shows a sketch of y = –3 – f(x)?"
And the "y", "f" and "x" in the equation are italicized. So if I export the flow to XML, the relevant paragraphElement looks like this:
<p>
<span>Which of the diagrams below shows a sketch of </span>
<span fontStyle="italic">y</span>
<span> = –3 – </span>
<span fontStyle ="italic">f</span>
<span> (</span>
<span fontStyle ="italic">x</span>
<span>)?</span>
</p>
I want to avoid the equation from breaking over a line, so I apply breakOpportunity="none" to the equation part. The resulting exported flow looks like this:
<p>
<span>Which of the diagrams below shows a sketch of </span>
<span fontStyle="italic" breakOpportunity="none">y</span>
<span breakOpportunity="none"> = –3 – </span>
<span fontStyle ="italic" breakOpportunity="none">f</span>
<span breakOpportunity="none"> (</span>
<span fontStyle ="italic" breakOpportunity="none">x</span>
<span breakOpportunity="none">)?</span>
</p>
The TLF seems to treat the successive "breakOpportunity" settings as a single group and doesn't break the equation. (It's a little hard to test, but by typing or deleting one character at a time before the equation, it never breaks.)
First question: could someone confirm that this is how it works?
It seems a little illogical to me, as the above XML suggests breaks should perhaps be allowed between the spans. For example, when used with Apache FOP for pdf generation, a simple template matching of attributes will allow breaking of the text between the spans.
What I really want to export is something like this:
<p>
<span>Which of the diagrams below shows a sketch of </span>
<span breakOpportunity="none">
<span fontStyle="italic" >y</span>
<span> = –3 – </span>
<span fontStyle ="italic">f</span>
<span> (</span>
<span fontStyle ="italic">x</span>
<span >)?</span>
</span>
</p>
But I don't see how to do this 'easily' with the available tools. I thought the new SubParagraphGroupElement might be of some help here, but I don't see how to attach one around some existing span elements in an editing environment. Is this possible or practical?
Any help appreciated.
