PDFBox
  1. PDFBox
  2. PDFBOX-954

Embedded font: value for /Widths faulty (worked in PDFBox 1.3.0!)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.4.0
    • Fix Version/s: 1.7.1
    • Component/s: FontBox
    • Labels:
      None
    • Environment:
      JDK1.6.0_23, Windows XP

      Description

      We have a problem with the font 'LucidiaSansUnicode (l_10646.ttf). It is embedded in a PDF and when viewing this PDF (with Acrobat Reader 9), an error

      In der Schrift "LucidaSansUnicode" ist der Wert für /Widths fehlerhaft.

      occurs (roughly translated: "In font "LucidaSansUNicode" the value for /Widths is faulty."). I noticed that this error only occurs when the first page is displayed that has text added by PDFBox! The same font is also used for all other text (used by Apache FOP to generate). When I look at the dialog window of Acrobat 3. tab "Fonts", I notice lots of entries

      LucidaSansUnicode (Eingebettete Untergruppe)
      Typ: TrueType (CID)
      Kodierung: Identity-H

      but only 1 entry at the very top that looks different:

      LucidaSansUnicode (Eingebettet)
      Typ: TrueType
      Kodierung: Ansi

      I guess one is from Apache FOP (generation of PDF) and one is from PDFBox (adding additional text to the PDF). However, both use the same source file "l_10646.ttf"!

      Using PDFBox 1.3.0-snapshot (or iText 2.1.7), this problem does NOT occur!

      This only occurs with this "LucidaSansUnicode" font - all our other custom fonts don't cause this problem.

      The difference I notice in Acrobat Reader Fonts tab is the first font entry:

      PDFBox 1.4.0:

      LucidaSansUnicode (Eingebettet)
      Typ: TrueType
      Kodierung: Ansi

      PDFBox 1.3.0 or iText 2.1.7:

      LucidaSansUnicode (Eingebettete Untergruppe)
      Typ: TrueType
      Kodierung: Ansi

      So, PDFBox 1.4.0 only shows "embedded" ("Eingebettet") but PDFBox 1.3.0/iText version shows "embedded subgroup" ("Eingebettete Untergruppe")! Perhaps this is the problem?

      1. hello_ttf_1.1.0.pdf
        416 kB
        Bob Swanson
      2. hello_ttf_1.4.0.pdf
        428 kB
        Bob Swanson
      3. Imagen 3.png
        42 kB
        David Villace
      4. Imagen 2.png
        53 kB
        David Villace
      5. Imagen 1.png
        16 kB
        David Villace
      6. out.pdf
        438 kB
        David Villace
      7. Main.java
        2 kB
        David Villace
      8. MainVer2.java
        4 kB
        David Villace
      9. outVer2.pdf
        416 kB
        David Villace
      10. MainVer2.java
        4 kB
        David Villace
      11. pdfbox-1.7.0-ttf-widths-encoding-fix.patch
        9 kB
        Wolfgang Glas

        Issue Links

          Activity

          MH created issue -
          MH made changes -
          Field Original Value New Value
          Summary Embedded font: value for /Widths faulty (Acrobat Reader 9) Embedded font: value for /Widths faulty (worked in PDFBox 1.3.0!)
          Description We have a problem with the font 'LucidiaSansUnicode (l_10646.ttf). It is embedded in a PDF and when viewing this PDF (with Acrobat Reader 9), an error

             In der Schrift "LucidaSansUnicode" ist der Wert für /Widths fehlerhaft.

          occurs (roughly translated: "In font "LucidaSansUNicode" the value for /Widths is faulty."). I noticed that this error only occurs when the first page is displayed that has text added by PDFBox! The same font is also used for all other text (used by Apache FOP to generate). When I look at the dialog window of Acrobat 3. tab "Fonts", I notice lots of entries

              LucidaSansUnicode (Eingebettete Untergruppe)
                  Typ: TrueType (CID)
                  Kodierung: Identity-H

          but only 1 entry at the very top that looks different:

              LucidaSansUnicode (Eingebettet)
                   Typ: TrueType
                  Kodierung: Ansi

          I guess one is from Apache FOP (generation of PDF) and one is from PDFBox (adding additional text to the PDF). However, both use the same source file "l_10646.ttf"!
          We have a problem with the font 'LucidiaSansUnicode (l_10646.ttf). It is embedded in a PDF and when viewing this PDF (with Acrobat Reader 9), an error

             In der Schrift "LucidaSansUnicode" ist der Wert für /Widths fehlerhaft.

          occurs (roughly translated: "In font "LucidaSansUNicode" the value for /Widths is faulty."). I noticed that this error only occurs when the first page is displayed that has text added by PDFBox! The same font is also used for all other text (used by Apache FOP to generate). When I look at the dialog window of Acrobat 3. tab "Fonts", I notice lots of entries

              LucidaSansUnicode (Eingebettete Untergruppe)
                  Typ: TrueType (CID)
                  Kodierung: Identity-H

          but only 1 entry at the very top that looks different:

              LucidaSansUnicode (Eingebettet)
                   Typ: TrueType
                  Kodierung: Ansi

          I guess one is from Apache FOP (generation of PDF) and one is from PDFBox (adding additional text to the PDF). However, both use the same source file "l_10646.ttf"!

          Using PDFBox 1.3.0-snapshot, this problem does NOT occur!
          MH made changes -
          Description We have a problem with the font 'LucidiaSansUnicode (l_10646.ttf). It is embedded in a PDF and when viewing this PDF (with Acrobat Reader 9), an error

             In der Schrift "LucidaSansUnicode" ist der Wert für /Widths fehlerhaft.

          occurs (roughly translated: "In font "LucidaSansUNicode" the value for /Widths is faulty."). I noticed that this error only occurs when the first page is displayed that has text added by PDFBox! The same font is also used for all other text (used by Apache FOP to generate). When I look at the dialog window of Acrobat 3. tab "Fonts", I notice lots of entries

              LucidaSansUnicode (Eingebettete Untergruppe)
                  Typ: TrueType (CID)
                  Kodierung: Identity-H

          but only 1 entry at the very top that looks different:

              LucidaSansUnicode (Eingebettet)
                   Typ: TrueType
                  Kodierung: Ansi

          I guess one is from Apache FOP (generation of PDF) and one is from PDFBox (adding additional text to the PDF). However, both use the same source file "l_10646.ttf"!

          Using PDFBox 1.3.0-snapshot, this problem does NOT occur!
          We have a problem with the font 'LucidiaSansUnicode (l_10646.ttf). It is embedded in a PDF and when viewing this PDF (with Acrobat Reader 9), an error

             In der Schrift "LucidaSansUnicode" ist der Wert für /Widths fehlerhaft.

          occurs (roughly translated: "In font "LucidaSansUNicode" the value for /Widths is faulty."). I noticed that this error only occurs when the first page is displayed that has text added by PDFBox! The same font is also used for all other text (used by Apache FOP to generate). When I look at the dialog window of Acrobat 3. tab "Fonts", I notice lots of entries

              LucidaSansUnicode (Eingebettete Untergruppe)
                  Typ: TrueType (CID)
                  Kodierung: Identity-H

          but only 1 entry at the very top that looks different:

              LucidaSansUnicode (Eingebettet)
                   Typ: TrueType
                  Kodierung: Ansi

          I guess one is from Apache FOP (generation of PDF) and one is from PDFBox (adding additional text to the PDF). However, both use the same source file "l_10646.ttf"!

          Using PDFBox 1.3.0-snapshot (or iText 2.1.7), this problem does NOT occur!

          This only occurs with this "LucidaSansUnicode" font - all our other custom fonts don't cause this problem.

          The difference I notice in Acrobat Reader Fonts tab is the first font entry:

          PDFBox 1.4.0:

              LucidaSansUnicode (Eingebettet)
                  Typ: TrueType
                  Kodierung: Ansi

          PDFBox 1.3.0 or iText 2.1.7:

              LucidaSansUnicode (Eingebettete Untergruppe)
                  Typ: TrueType
                  Kodierung: Ansi


          So, PDFBox 1.4.0 only shows "embedded" ("Eingebettet") but PDFBox 1.3.0/iText version shows "embedded subgroup" ("Eingebettete Untergruppe")! Perhaps this is the problem?
          MH made changes -
          Comment [ Just switched back to iText adding the same text with the very same font and the error does not occur. => problem in PDFBox embedding fonts. This only occurs with this "LucidaSansUnicode" font - all our other custom fonts don't cause this problem.

          The difference I notice in Acrobat Reader Fonts tab is the first font entry:

          PDFBox 1.4.0:

              LucidaSansUnicode (Eingebettet)
                  Typ: TrueType
                  Kodierung: Ansi

          iText 2.1.7:

              LucidaSansUnicode (Eingebettete Untergruppe)
                  Typ: TrueType
                  Kodierung: Ansi


          So, PDFBox only shows "embedded" ("Eingebettet") but iText version shows "embedded subgroup" ("Eingebettete UNtergruppe")!

          This problem does not occur with PDFBox 1.3.0-snapshot! So this was introduced with some change in PDFBox 1.4.0. ]
          Bob Swanson made changes -
          Attachment hello_ttf_1.1.0.pdf [ 12473472 ]
          Attachment hello_ttf_1.4.0.pdf [ 12473473 ]
          Andreas Lehmkühler made changes -
          Assignee Andreas Lehmkühler [ lehmi ]
          David Villace made changes -
          Attachment Imagen 3.png [ 12507576 ]
          Attachment Imagen 2.png [ 12507577 ]
          Attachment Imagen 1.png [ 12507578 ]
          Attachment out.pdf [ 12507579 ]
          David Villace made changes -
          Attachment Main.java [ 12507583 ]
          David Villace made changes -
          Attachment MainVer2.java [ 12507786 ]
          David Villace made changes -
          Attachment outVer2.pdf [ 12507787 ]
          David Villace made changes -
          Attachment MainVer2.java [ 12507800 ]
          Wolfgang Glas made changes -
          Attachment pdfbox-1.7.0-ttf-widths-encoding-fix.patch [ 12533947 ]
          Wolfgang Glas made changes -
          Wolfgang Glas made changes -
          Attachment pdfbox-1.7.0-ttf-widths-encoding-fix.patch [ 12533947 ]
          Andreas Lehmkühler made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 1.8.0 [ 12321650 ]
          Resolution Fixed [ 1 ]
          Andreas Lehmkühler made changes -
          Fix Version/s 1.7.1 [ 12322469 ]
          Fix Version/s 1.8.0 [ 12321650 ]
          Andreas Lehmkühler made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Andreas Lehmkühler made changes -
          Link This issue is duplicated by PDFBOX-1567 [ PDFBOX-1567 ]

            People

            • Assignee:
              Andreas Lehmkühler
              Reporter:
              MH
            • Votes:
              4 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development