W3C home > Mailing lists > Public > www-xsl-fo@w3.org > November 2004

right alignment is not correct with some fonts

From: Patrick Buchinger <patrick@buchinger.net>
Date: Tue, 02 Nov 2004 13:38:24 +0100
To: xsl-fo Maillisting <www-xsl-fo@w3.org>
Message-Id: <1099399104.16495.42.camel@dumpfbacke.linz1.at>

hello list!

first of all, i am using Apache FOP.


what i want to do is the following:
i have two texts which are positioned within a block. the
block-containers the blocks live in have exactly the same coordinates
except "top".. both texts have text-align="right", so the texts should
exactly be placed one below the other with the same right border.

here is the code i used to achieve this;


  <fo:block-container position="absolute" left="20.0mm" top="16.0mm"
width="30mm" height="55mm">
    <fo:block font-family="Arial" font-size="2.0mm" text-align="right"
font-weight="normal">
      <xsl:text>TeTeTeTe</xsl:text>
    </fo:block>
  </fo:block-container>

  <fo:block-container position="absolute" left="20.0mm" top="14.0mm"
width="30mm" height="55mm">
    <fo:block font-family="Arial" font-size="2.0mm" text-align="right"
font-weight="normal">
      <xsl:text>The</xsl:text>
    </fo:block>
  </fo:block-container>



the problem no is, the the texts do not have the same right border! it
seams as if the 'e' of "Te" gets moved "under" the 'T'. so the text "Te"
is more right (but still too much on the left side compared to the text
"The") than the text "TeTeTeTe".

I saw the same wrong behaviour with "Fr", "Ti" and "Ir", but i'm sure
the list is not complete.


The same code with font-family="Times" works as expected, so the problem
is font depended.


can anyone explain this or even provide a "workaround" for this problem?

thank you,

Patrick Buchinger
Received on Tuesday, 2 November 2004 12:38:29 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 3 October 2007 16:06:13 GMT