Underline a block element with different font sizes without breaking the line

I am trying to emphasize a block element containing text. The block has a font-size attribute, and the text inside the block is surrounded by an inline element, which has a different font-size attribute.

Is there a way to guarantee that the line obtained from text-decoration="underline" external block is a straight line over the entire block element (without any "gaps" - see the attached image), which does not change it with the font size?

My code is:

 <fo:block font-size="14pt" text-decoration="underline"> Some text <fo:inline font-size="10pt"> text with a smaller font size </fo:inline> Another text </fo:block> 

My result:

Problem with undelined block with different font sizes

Thanks in advance!

+7
xsl-fo apache-fop
source share
1 answer

I have two versions of the XSL-FO engine from the same vendor, and the most modern version displays the general underline without spaces, while the older version displays what you see with FOP. So it depends on the implementation.

But you can mimic the look of what you want, selectively using a border, rather than relying on an implementation:

  <block font-size="14pt"> <inline border-after-width="1pt" border-after-style="solid"> Some text <inline font-size="10pt"> text with a smaller font size </inline> Another text </inline> </block> 

Whether this facial expression is in FOP or not, I do not know how I do not use FOP.

+7
source share

All Articles