Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-1831

[PATCH] Fix: "Foreign" characters are not rendered

    XMLWordPrintableJSON

Details

    Description

      This is a patch to fix PDFBOX-1691, I've opened it as its own issue because it's quite a large patch.

      The issue it fixes is that the Type 1 "seac" command was not implemented. Seac is a command which draws a composite glyph from two other glyphs. This requires that the Type 1 renderer has access to any of the other rendered glyphs in a CFFFont, which is why this patch is non-trivial. The major change is that the CharStringRenderer has been refactored into a new Type1CharString class and the CharStringConverter has been refactored into a new Type2CharString class. A lot of code has been moved around, but overall this is a conservative patch, as most of the code has not changed significantly.

      As well as the patch, there are 3 new files:

      + fontbox/src/main/java/org/apache/fontbox/cff/Type1CharString.java
      + fontbox/src/main/java/org/apache/fontbox/cff/Type2CharString.java
      + fontbox/src/main/java/org/apache/fontbox/encoding/StandardEncoding.java

      and two deleted files:

      • fontbox/src/main/java/org/apache/fontbox/cff/CharStringRenderer.java
      • fontbox/src/main/java/org/apache/fontbox/cff/CharStringConverter.java

      Attachments

        1. Type2CharString.java
          12 kB
          John Hewson
        2. Type1CharString.java
          8 kB
          John Hewson
        3. StandardEncoding.java
          8 kB
          John Hewson
        4. diff.patch
          21 kB
          John Hewson
        5. 1822-agb.pdf-3.png
          666 kB
          Tilman Hausherr

        Issue Links

          Activity

            People

              lehmi Andreas Lehmkühler
              jahewson John Hewson
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: