PDF/A validation fails with OTF fonts
Compiling a LaTeX document using Fantasque Sans Mono font with the LuaLaTeX engine, the output fails PDF/A validation with the veraPDF software when using (any of the) OTF font variants in the LaTeX document. It works using (any of the) TTF font variants, though.
Symptom:
veraPDF seems to complain about inconsistent font metrics (see last line):
Specification: ISO 19005-1:2005, Clause: 6.3.6, Test number: 1 For every font embedded in a conforming file and used for rendering, the glyph width information in the font dictionary and in the embedded font program shall be consistent. Failed 4 occurrences Glyph renderingMode == 3 || widthFromFontProgram == null || widthFromDictionary == null || Math.abs(widthFromFontProgram - widthFromDictionary) <= 1 root/document[0]/pages[0](5 0 obj PDPage)/contentStream[0](7 0 obj PDContentStream)/operators[11]/usedGlyphs[1](CGGIZD+FantasqueSansMono-Regular CGGIZD+FantasqueSansMono-Regular 70 0 0) Glyph width 1060 in the embedded font program is not consistent with the Widths entry of the font dictionary (value 517.6)
System:
- Ubuntu 20.04
- TeXLive (as provided by Ubuntu)
- font: Fantasque Sans Mono v1.7.2 (as provided by Ubuntu)
- PDF/A validation: veraPDF v1.23.235-gf (requires Java)
- Java: OpenJDK 11 (as provided by Ubuntu)
Steps to reproduce:
Install TeXLive: The attached LaTeX document uses the LuaLaTeX engine and package pdfx to output PDF/A compliant files. Make sure, the following Ubuntu packages are installed (plus additional dependencies):
texlive-latex-basetexlive-luatextexlive-latex-recommendedtexlive-latex-extra
Be warned that total installation size may be more than 500 MB!
Install Java Runtime: E.g. via command
apt install openjdk-11-jre.Install the free PDF validation software veraPDF (requires Java):
Download installation package from here.
Note, there are two flavours of the veraPDF validation engine, greenfield (gf) and pdfbox. Stick to the greenfield flavour, which is the more recent one.
Unzip the downloaded veraPDF ZIP archive.
Run the extracted
verapdf-installscript in a terminal.Follow the installation procedure. (Install veraPDF into any user-writable directory, e.g.,
$HOME/veraPDF-<version>-gf/. Uninstallation is as easy as removing the installation directory. Default installation "packs" selection is OK.)
Compile the attached LaTeX document:
E.g., via command
$ lualatex bug-pdfa.texNote, at the end of terminal output, the actual paths font files where taken from are shown, e.g.:
</usr/share/fonts/opentype/fantasque-sans/Normal/OTF/FantasqueSansMono-Regular. otf>Validate PDF/A conformance:
$ $HOME/verapdf-<version>-gf/verapdf --format text bug-pdfa.pdf FAIL bug-pdfa.pdfNote, the
--format textoption only shows aFAILorPASSmessage. To see the actual error message, try with different--formatoption arguments (seeverapdf --help) or use theverapdf-guiprogramme (from the veraPDF installation directory), which lets you easily open a HTML report in the browser.Repeat the last two steps with varying
Patharguments in the.texsource file. The.texfile contains 16 alternativeExtension/Pathargument lines for the four OTF font variants, four TTF font variants (all picked-up from a system-wide installation), and then the same eight font variants picked-up from the local repository. Please runmake allin the top-level repository directory first, if you want to try the latter. Adjust allPatharguments in the.texsource file as needed.Note, for repeated tests on the shell, I use the following invocation:
$ lualatex bug-pdfa.tex | tail -20 | awk "/^</,/^Output/" && verapdf --format text bug-pdfa.pdfwhich just extracts font paths from LaTeX terminal output and does PDF/A validation in one go. For this to work, I actually have a link from the
verapdfbinary to$HOME/bin/verapdf. But you can as well apply the full path to yourverapdfbinary in the command.
Can anyone reproduce this?
Source: belluzj/fantasque-sans