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

TTFParser can't parse font with legitimately no 'loca' table

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Reopened
    • Major
    • Resolution: Unresolved
    • 2.0.23
    • None
    • FontBox, PDModel
    • None
    • ➜ uname -a
      Linux frenchfrie-pc 5.10.42-1-MANJARO #1 SMP PREEMPT Thu Jun 3 14:37:11 UTC 2021 x86_64 GNU/Linux

    Description

      Some fonts legitimately do not have a 'loca' table as specified in Apple documentation:

      The 'loca' table only used with fonts that have TrueType outlines (that is, a 'glyf' table). Fonts that have no TrueType outlines do not require a 'loca' table.

      This has led to some misunderstanding in the NotoColorEmoji google font project as testified by those issues :

      https://github.com/googlefonts/noto-emoji/issues/190

      https://github.com/googlefonts/noto-emoji/issues/288

      Also reproduced with JoyPixels.ttf from https://www.joypixels.com/ installed through package manager.

       

      The TTFParser class just do not accept this font based on the absence of the 'loca' table and it can be verified with the simple test:

      PDType0Font.load(doc, getClass().getResourceAsStream("NotoColorEmoji.ttf"), false);
      

      Attachments

        1. pdfbox_generated_with_invisible_emojis_afterLOD.pdf
          6 kB
          Frenchfrie
        2. expected result (from GDocs).pdf
          46 kB
          Frenchfrie
        3. emo.pdf
          184 kB
          Tilman Hausherr

        Activity

          People

            Unassigned Unassigned
            frenchfrie Frenchfrie
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated: