Fop
  1. Fop
  2. FOP-1141

white-space incorrectly handled after linefeed

    Details

    • Type: Bug Bug
    • Status: Closed
    • Resolution: Fixed
    • Affects Version/s: 0.91
    • Fix Version/s: None
    • Component/s: unqualified
    • Labels:
      None
    • Environment:
      Operating System: other
      Platform: Other
    • External issue ID:
      38457

      Description

      Not sure if it is supposed to be or I was using it wrong. The PDF generated
      from following snippet shows no line breaks between the lines, so all text
      within the block is wrapped up in one line.

      Please instruct. Thank you very much.

      <fo:block font-family="monospace" white-space="pre" >
      public class Sample
      {
      public static void main(String [] args)

      { System.out.println("Hello, World!"); }

      }
      </fo:block>

        Activity

        Hide
        Andreas L. Delmelle added a comment -

        Hi,

        Which version of FOP are you using exactly? I mean, if you're using the binaries, then you're out of luck...
        As I recall, support for the white-space shorthand was added shortly after the last release. If you can, try
        checking out the latest trunk source via SVN.
        Another alternative: use the three basic properties
        <fo:block linefeed-treatment="preserve" white-space-treatment="preserve"
        white-space-collapse="false" wrap-option="no-wrap">

        HTH!

        Show
        Andreas L. Delmelle added a comment - Hi, Which version of FOP are you using exactly? I mean, if you're using the binaries, then you're out of luck... As I recall, support for the white-space shorthand was added shortly after the last release. If you can, try checking out the latest trunk source via SVN. Another alternative: use the three basic properties <fo:block linefeed-treatment="preserve" white-space-treatment="preserve" white-space-collapse="false" wrap-option="no-wrap"> HTH!
        Hide
        li hao added a comment -

        Thanks for your quick response. I am using FOP 0.91beta.

        I tried your suggested alternative of using three basic properties. It worked
        nicely to break the lines but failed to preserve the spaces at the beginning
        of each line.

        Any suggestions? I appreciate it.

        Show
        li hao added a comment - Thanks for your quick response. I am using FOP 0.91beta. I tried your suggested alternative of using three basic properties. It worked nicely to break the lines but failed to preserve the spaces at the beginning of each line. Any suggestions? I appreciate it.
        Hide
        Manuel Mall added a comment -

        This is a known problem. Unfortunately there is no simple workaround. Replacing
        all spaces with non breaking space would do the trick but that is not easily
        done using a stylesheet I believe.

        Show
        Manuel Mall added a comment - This is a known problem. Unfortunately there is no simple workaround. Replacing all spaces with non breaking space would do the trick but that is not easily done using a stylesheet I believe.
        Hide
        Pavel Tyl added a comment -

        (In reply to comment #3)
        > This is a known problem. Unfortunately there is no simple workaround. Replacing
        > all spaces with non breaking space would do the trick but that is not easily
        > done using a stylesheet I believe.

        Is there already any resolution for this problem with white spaces on the
        beggining of the line?

        Show
        Pavel Tyl added a comment - (In reply to comment #3) > This is a known problem. Unfortunately there is no simple workaround. Replacing > all spaces with non breaking space would do the trick but that is not easily > done using a stylesheet I believe. Is there already any resolution for this problem with white spaces on the beggining of the line?
        Hide
        Andreas L. Delmelle added a comment -

        Hmm... changing the summary, because it's misleading (maybe there's a duplicate of this bug somewhere,
        I'll look it up later).

        Very briefly, to bar all t's:
        The white-space property is implemented, only the small part white-space-treatment='after-
        linefeed'/'preserve' isn't handled correctly, but in essence, the properties infrastructure does offer full
        support for the shorthand.
        :-/

        Show
        Andreas L. Delmelle added a comment - Hmm... changing the summary, because it's misleading (maybe there's a duplicate of this bug somewhere, I'll look it up later). Very briefly, to bar all t's: The white-space property is implemented, only the small part white-space-treatment='after- linefeed'/'preserve' isn't handled correctly, but in essence, the properties infrastructure does offer full support for the shorthand. :-/
        Hide
        Manuel Mall added a comment -
        Show
        Manuel Mall added a comment - That should be fixed now ( http://svn.apache.org/viewcvs.cgi?rev=392488&view=rev ).
        Hide
        Glenn Adams added a comment -

        batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed

        Show
        Glenn Adams added a comment - batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed

          People

          • Assignee:
            fop-dev
            Reporter:
            li hao
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development