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

Font gets smaller for each rendered page

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.27, 3.0.0 PDFBox
    • 2.0.28, 3.0.0 PDFBox
    • Rendering
    • None

    Description

      Every time the page in the attached document is re-rendered, the font gets smaller.
      First rendering:

      Second rendering:

      Reloading the complete document resets the font size.

      This is probably caused in TTFGlyph2D.getPathForGID

      The problematic text rendering uses scaling,
      so the path gotten in the line

      GeneralPath glyph = vectorFont.getPath(code);
      

      is rescaled in

                      if (hasScaling)
                      {
                          AffineTransform atScale = AffineTransform.getScaleInstance(scale, scale);
                          glyphPath.transform(atScale);
                      }
      

      This should probably be done on a cloned path.

      Attachments

        1. Rechnung_001 (1).pdf
          1.88 MB
          Oliver Schmidtmer
        2. image-2023-02-17-20-06-41-326.png
          22 kB
          Oliver Schmidtmer
        3. image-2023-02-17-20-06-11-031.png
          27 kB
          Oliver Schmidtmer

        Activity

          People

            tilman Tilman Hausherr
            Schmidor Oliver Schmidtmer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: