FOP
  1. FOP
  2. FOP-1349

[PATCH] ZWSP works as backspace when font is embedded

    Details

    • Type: Bug Bug
    • Status: Closed
    • Resolution: Fixed
    • Affects Version/s: trunk
    • Fix Version/s: None
    • Component/s: renderer/pdf
    • Labels:
      None
    • Environment:
      Operating System: All
      Platform: All
    • External issue ID:
      42109

      Description

      When fonts are embedded in the PDF, zero-width spaces have a backspace effect:
      the text following the ZWSP is left-shifted by about one character's width, so
      it partly overprints the preceding text. At the end of a text area containing
      ZWSPs there's extra whitespace, up to the point where the text would have ended
      had it been rendered correctly.

      Observed with Times, Verdana and MSMincho, but not with Courier, and only if the
      font is embedded in the PDF file. It makes no difference whether the metrics
      file has an entry for ZWSP (8203d) or not.

      Attached are a FO and a PDF file demonstrating the effect. I also attach a patch
      that intercepts non-stretchable ZWSPs before they are written to the PDF stream.
      This doesn't address the cause of the problem so it's probably not the best
      solution, but at least it cures the disease. And there's no point in writing
      zero-dimension areas to the PDF anyway.

      1. PDFRenderer.java
        63 kB
        Paul Vinkenoog
      2. test-zwsp.fo
        1 kB
        Paul Vinkenoog
      3. test-zwsp.pdf
        29 kB
        Paul Vinkenoog
      4. zwsp.patch
        1 kB
        Paul Vinkenoog
      5. zwsp-layout.patch
        5 kB
        Paul Vinkenoog

        Activity

        Paul Vinkenoog created issue -

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development