Maria Lowas created FOP-2331:
--------------------------------

             Summary: Padding on fo:inline ignored when computing justification 
spacing on a line
                 Key: FOP-2331
                 URL: https://issues.apache.org/jira/browse/FOP-2331
             Project: Fop
          Issue Type: Bug
          Components: pdf
    Affects Versions: 1.1
         Environment: Linux, DocBook
            Reporter: Maria Lowas
            Priority: Minor
         Attachments: wrong_rendering.png

It seems that the padding attribute on the fo:inline element is ignored when 
computing justification space on a line. Please have a look at the attached 
image to see the outcome - the background image for the link element is covered 
by the next characters and the line is not justified correctly.

This problem does not occur for each instance of the external link in my docs. 
In other words, sometimes a line is justified correctly and sometimes its not. 
I was not able to find any regularity in this behaviour.

I am using DocBook stylesheets version 1.75.1 with FOP 1.1. FOP is called from 
the shell script.

My source XML is:
<para>The <olink targetptr="client_push_notifications_api">push
      notifications Java Script API</olink> provides a way to register an 
application running on the
    client device for receiving the AMP Services Engine-originated ACF-based 
messages ("ACF Push").
    To enable push notifications being sent by the notification service, it is 
necessary for the
    device to provide an up-to-date token to a matching service: <link 
role="external"
      
xlink:href="http://developer.android.com/guide/google/gcm/index.html";>Google 
Cloud
      Messaging</link> for Android and <link role="external"
      
xlink:href="http://developer.apple.com/library/mac/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/ApplePushService/ApplePushService.html";
      >Apple Push Notification Service</link> for iOS platform. Refer to the 
article entitled <olink
      targetptr="client_push_notifications_acf"/> for the configuration 
details.</para>

my XSLT addition to the DocBook stylesheets:
<xsl:attribute-set name="xref.properties">
    <xsl:attribute name="color">#B64F0D</xsl:attribute>
    <xsl:attribute name="text-decoration">
      <xsl:choose>
        <xsl:when test="@role = 'external'">underline</xsl:when>
        <xsl:otherwise>none</xsl:otherwise>
      </xsl:choose>
    </xsl:attribute>
    <xsl:attribute name="background-image">
      <xsl:if test="@role = 'external'"
        >../../../sources/graphics/common/icon_external_orange_pdf.png</xsl:if>
    </xsl:attribute>
    <xsl:attribute name="padding-right">
      <xsl:choose>
        <xsl:when test="@role ='external'">10pt</xsl:when>
        <xsl:otherwise>0pt</xsl:otherwise>
      </xsl:choose>
    </xsl:attribute>
    <xsl:attribute name="background-position-horizontal">right</xsl:attribute>
    <xsl:attribute name="background-repeat">no-repeat</xsl:attribute>
  </xsl:attribute-set>

And the resulted FO document:
<fo:block space-before.optimum="5pt" space-before.minimum="5pt" 
space-before.maximum="5pt">The
          <fo:basic-link internal-destination="client_push_notifications_api" 
color="#B64F0D"
          text-decoration="none" background-image="" padding-right="0pt"
          background-position-horizontal="right" 
background-repeat="no-repeat">push notifications
          Java Script API<fo:basic-link 
xmlns:rx="http://www.renderx.com/XSL/Extensions";
            internal-destination="client_push_notifications_api" color="#B64F0D"
            text-decoration="none" background-image="" padding-right="0pt"
            background-position-horizontal="right" 
background-repeat="no-repeat"><fo:inline
              color="#7E7E7E"> [<fo:page-number-citation 
ref-id="client_push_notifications_api"
              />]</fo:inline></fo:basic-link></fo:basic-link> provides a way to 
register an
        application running on the client device for receiving the AMP Services 
Engine-originated
        ACF-based messages ("ACF Push"). To enable push notifications being 
sent by the notification
        service, it is necessary for the device to provide an up-to-date token 
to a matching
        service: <fo:basic-link
          
external-destination="url(http://developer.android.com/guide/google/gcm/index.html)"
            ><fo:inline color="#B64F0D" text-decoration="underline"
            
background-image="../../../sources/graphics/common/icon_external_orange_pdf.png"
            padding-right="10pt" background-position-horizontal="right"
            background-repeat="no-repeat">Google Cloud 
Messaging</fo:inline></fo:basic-link> for
        Android and <fo:basic-link
          
external-destination="url(http://developer.apple.com/library/mac/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/ApplePushService/ApplePushService.html)"
            ><fo:inline color="#B64F0D" text-decoration="underline"
            
background-image="../../../sources/graphics/common/icon_external_orange_pdf.png"
            padding-right="10pt" background-position-horizontal="right"
            background-repeat="no-repeat">Apple Push Notification
          Service</fo:inline></fo:basic-link> for iOS platform. Refer to the 
article entitled
          <fo:basic-link internal-destination="client_push_notifications_acf" 
color="#B64F0D"
          text-decoration="none" background-image="" padding-right="0pt"
          background-position-horizontal="right" 
background-repeat="no-repeat">AMP Services
          Engine-originated ACF-based notifications<fo:basic-link
            xmlns:rx="http://www.renderx.com/XSL/Extensions";
            internal-destination="client_push_notifications_acf" color="#B64F0D"
            text-decoration="none" background-image="" padding-right="0pt"
            background-position-horizontal="right" 
background-repeat="no-repeat"><fo:inline
              color="#7E7E7E"> [<fo:page-number-citation 
ref-id="client_push_notifications_acf"
              />]</fo:inline></fo:basic-link></fo:basic-link> for the 
configuration
        details.</fo:block>



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to