Uploaded image for project: 'FOP'
  1. FOP
  2. FOP-2993

With PDFBox 2.0.22: Failed to embed font / Illegal offSize value 0 in CFF font

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Invalid
    • 2.5
    • None
    • font/opentype
    • None
    • Arch Linux

    Description

      This bug did not show with PDFBox 2.0.21 and appeared with PDFBox 2.0.22 so it may actually be a bug in PDFBox (or with this font). However, it may be related to PDFBOX-5033. Moreover, I have no use for PDFBox besides FOP and don't know how to test the fontbox jar without FOP.

      To trigger this bug, run fop on this this .fo: 

      <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
        <fo:layout-master-set>
          <fo:simple-page-master master-name="one">
            <fo:region-body />
          </fo:simple-page-master>
        </fo:layout-master-set>
        <fo:page-sequence master-reference="one">
          <fo:flow flow-name="xsl-region-body">
            <fo:block font-family="FreeMono">Text</fo:block>
          </fo:flow>
        </fo:page-sequence>
      </fo:root>
      

       This causes the following exception; the full exception backtrace is attached:

      Jan 07, 2021 11:44:37 AM org.apache.fop.apps.FOUserAgent processEvent
      INFO: Rendered page #1.
      Jan 07, 2021 11:44:37 AM org.apache.fop.pdf.PDFFactory makeFontFile
      SEVERE: Failed to embed font [org.apache.fop.fonts.LazyFont@5d25e6bb{FreeMono}{metrics-url=null,embed-url=/usr/share/fonts/gnu-free/FreeMono.otf,kerning=true,advanced=true}] FreeMono
      java.io.IOException: Illegal (< 1 or > 4) offSize value 0 in CFF font at position 42277
      at org.apache.fontbox.cff.CFFDataInput.readOffSize(CFFDataInput.java:85)

      This bug triggers with all GNU Free fonts, but not with any of the other OTF fonts I tried.

      I also attach my fop.xconf (with explicit <font> specifications because of FOP-2591).

      Attachments

        1. exception-backtrace.txt
          12 kB
          Justus Piater
        2. fop.xconf
          3 kB
          Justus Piater

        Activity

          People

            Unassigned Unassigned
            justus-bulk@piater.name Justus Piater
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: