Jeremias Maerki wrote:
Try rendering your document using the PDF renderer and check if the
white-space gets underlined. I would guess so.
Which is, unfortunately, wrong. In the following FO
<fo:block>a <fo:inline text-decoration=
"underline"> b c </fo:inline> d</fo:block>
The spaces just before b and after c are not underlined.
This is actually one of the not quite clear areas of the spec.
7.15.12 "white-space-collapse" says: "after refinement, where
some white space characters may have been discarded or turned
into space characters, all remaining runs of two or more
consecutive spaces are replaced by a single space, then any
remaining space immediately adjacent to a remaining linefeed
is also discarded."
It is not really obvious whether this collapsing extends
across FO borders. If it doesn't, inserting fo:inline could
be used to intentionally or unintentionally insert runs of
whitespace, which is counterintuitive. But then, there is a
lot of not really intuitive stuff elsewhere in the spec. FOP
collapses the spaces anyway.
The other problem is that the formal application of the
collapsing algorithm would discard the space before b but
keep the space after c in favor of the space before d, which
would result in an underlined space after c and a not
underlined space before b. Yuk! I tend to believe this
facilitated the decision not to underline leading and trailing
spaces in fo:inlines.
The space between b and c is always underlined.
There was a short but inconclusive discussion about this on
fop-dev some time ago, I believe Peter sent a question to the
XSL editors as a result.
Next problem: FOP does not underline the spaces before b and
after c even if white-space-collapse="false" is used and the
spaces are not collapsed.
I think I told the last one asking this to use the underline
character _ The glyph underline may be a bit off of the
text decoration underline, but it's better than nothing.
Another possibility is to find a non-space character with a
glyph which blends with the underlining and insert it before
and after the spaces, like
¸ b c ¸</fo:inline>
Unfortunately, the cedille ¸ is still visible, but one
of the countless combining dots surely will do. ̣ looks
promising but requires MS Arial, and I'm just too lazy to install
it in order to check.