Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.2, 2.0.3, 3.0.0 PDFBox
    • Fix Version/s: 2.0.9, 3.0.0 PDFBox
    • Component/s: Rendering
    • Labels:
      None

      Description

      Fonts rendered in wrong size. The cause is related to wrong values in the /WIDTHS table and this code in PageDrawer:

                  // stretch non-embedded glyph if it does not match the width contained in the PDF
                  if (!font.isEmbedded())
                  {
                      float fontWidth = font.getWidthFromFont(code);
                      if (fontWidth > 0 && // ignore spaces
                              Math.abs(fontWidth - displacement.getX() * 1000) > 0.0001)
                      {
                          float pdfWidth = displacement.getX() * 1000;
                          at.scale(pdfWidth / fontWidth, 1);
                      }
                  }
      

      I suspect that there must be another condition to skip the stretching, but I didn't find out which one.

        Attachments

        1. PDFJS-7523.pdf
          7 kB
          Tilman Hausherr
        2. PDFJS-5550.pdf
          183 kB
          Tilman Hausherr
        3. PDFBOX-2642-HACK.pdf
          201 kB
          John Hewson
        4. PDFBOX_3457.patch
          5 kB
          John Hewson
        5. PDFBOX_3457_v2.patch
          11 kB
          John Hewson
        6. overlapping.png
          2 kB
          John Hewson
        7. osx.png
          47 kB
          John Hewson
        8. gs-bugzilla693663-p9-stretchdisabled.png
          33 kB
          Tilman Hausherr
        9. gs-bugzilla693663-p91_part.png
          56 kB
          Andreas Lehmkühler
        10. gs-bugzilla693663-p9.pdf
          144 kB
          Tilman Hausherr
        11. bug864847.pdf
          1 kB
          Tilman Hausherr

          Issue Links

            Activity

              People

              • Assignee:
                tilman Tilman Hausherr
                Reporter:
                tilman Tilman Hausherr
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: