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

FontName value written in font descriptor from QPDFWriter is out of spec

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.12.3
    • Fix Version/s: None
    • Labels:
      None
    • Platform/s:
      Windows

      Description

      According to the Adobe PDF Reference Specification (see page 356), a font descriptor should use the PostScript name of the font as the value of the FontName entry, to wit:

      The PostScript name of the font. This should be the same as the value of BaseFont in the font or CIDFont dictionary that refers to this font descriptor.

      What QPDFWriter does instead is use the complete path to the font file on Windows, e.g. for our OpenType PS font Bravura:

      Windows: /FontName /QOAAAA+C:\WINDOWS\FONTS\BRAVURA_0.OTF
      macOS: /FontName /QTAAAA+Bravura

      The presence of the QOAAAA+ and QTAAAA+ prefixes is appropriate because the embedded font is a subset (per section 5.5.3 of the specification), but I believe according to the PDF specification, the Windows name should match the macOS one.

      Using the full path to the font has the consequence that if you open the resulting PDF file in Adobe Illustrator, the font will be reported as not being found on the system, even if the font file is installed.

      Is there a good reason why the FontName entry is written in this fashion on Windows? It appears to be out of spec.

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            • Assignee:
              vgt Eirik Aavitsland
              Reporter:
              dspreadbury Daniel Spreadbury
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:

                Gerrit Reviews

                There are no open Gerrit changes