7

I am trying to underline an block element that contains text. The block has an font-size attribute and the text within the block is surrounded by an inline element which has a different font-size attribute.

Is there any way to ensure, that the line resulting from the text-decoration="underline" of the outer block is a straight line over all the block element (without any 'gaps' - please see the attached picture) that is not changing its position with the font-size ?

My code:

<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!

4

1 回答 1

8

我有来自一个供应商的两个版本的 XSL-FO 引擎,最新版本呈现一个没有间隙的公共下划线,而旧版本呈现您使用 FOP 看到的内容。所以它似乎依赖于实现。

但是您可以通过有选择地使用边框而不是依赖于实现来模仿您想要的外观:

  <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>

这种模仿是否适用于 FOP,我不知道,因为我不使用 FOP。

于 2013-07-02T12:45:18.947 回答