Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-125405

QPdfWriter must use a cmap table for embedded TrueType fonts

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.7.0
    • GUI: Text handling
    • None
    • 2fbece8a7 (dev), a30591603 (6.8)

    Description

      PDF 1.6 at page 400 says:

      A font that is used to display glyphs that do not use MacRomanEncoding or
      WinAnsiEncoding should not specify an Encoding entry. The font descriptor’s
      Symbolic flag (see Table 5.20) should be set, and its font program’s “cmap” table
      should contain a (1, 0) subtable. It may also contain a (3, 0) subtable; if present,
      this subtable should map from character codes in the range 0xF000 to 0xF0FF
      by prepending the single-byte codes in the (1, 0) subtable with 0xF0 and map-
      ping to the corresponding glyph descriptions.

      QPdfWriter only uses symbolic fonts. However, it generates a /Encoding /Identity-H entry in the Font dictionary, and does not write a cmap table at all (QFontSubset doesn't seem to extract it).

      PDF/A-1b and PDF/X-4 are even more restrictive, as they say:

      All symbolic TrueType fonts shall not specify an Encoding entry in the font dictionary, and their font programs' “cmap” tables shall contain exactly one encoding.

      NOTE: This requirement makes normative the suggested guidelines described in PDF Reference 5.5.5.

      (e.g. https://www.soliddocuments.com/iso-19005-1-compliance.htm?subject=6.3.7 )

      Therefore we're producing non-conforming PDF files in these modes. I'm not 100% sure how to fix this though. Ideas?

      Attachments

        For Gerrit Dashboard: QTBUG-125405
        # Subject Branch Project Status CR V

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            peppe Giuseppe D'Angelo
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes