groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] Something broke embedded fonts in gropdf output (but not grops)


From: Jim Avera
Subject: [groff] Something broke embedded fonts in gropdf output (but not grops)
Date: Thu, 15 Feb 2018 17:06:40 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:57.0) Gecko/20100101 Thunderbird/57.0

Hello,

Something changed between Ubuntu 16.04 and 17.10 which makes locally-installed fonts not render correctly in PDFs generated with groff -Tpdf.   However groff -Tps produces correctly-rendering postscript (files in devps/ and devpdf/ are identical).   Ubuntu 17.10 has */groff 1.22.3/* and */ghostscript 9.21/*.   I'm sorry but I don't know the earlier version nos.

To rule out a font-installation problem (mostly), I created a script which re-installs a font set into a temporary directory and runs tests without any local environment variables set, except for GROFF_FONT_PATH and GS_FONTPATH, which are set to point only to temporary directories generated by the script.  See below.

There are some odd symptoms:

1.  If pdf2ps is run on the "broken" pdf file, the resulting postscript renders correctly!  And ps2pdf on _that_ produces a working .pdf file.

That makes me suspect something in gropdf's output confuses ghostscript.

2.  The "gv" viewer, alone, does not exhibit the problem -- it renders the pdf correctly. But /every other/ /renderer/ I've tried (evince, xpdf) AND a physical printer render the gropdf output incorrectly: The locally-defined font is replaced with a weird sans-serif font, but with boldness and/or italicness preserved.

(The printer, which also renders incorrectly, is a Brother MFC-9340-CDW using a Brother-provided CUPS driver; I assume the driver uses ghostscript to convert pdf to an image, but am not certain.  The printer does not have native Postscript support.)

Troff is finding it's font description files -- no warning about missing fonts occur.  And the desired font names _are_ mentioned inside the generated pdf.


I'm really lost here.   I hope I'm not wasting your time...

Attached are the following:

1. grofftest.sh  -  a self-contained script to reproduce the problem.

It contains uuencoded .ttf font files (HP's "Dark Courier" fonts) and uses ttf2ufm and afmtodit to generate the other files needed by groff and ghostscript.

It runs troff -Tpdf or troff -Tps and saves the intermediate results; then runs gropdf or grops with strace, to help see what files they access.   Finally, it runs pdf2ps on the output from gropdf, again under strace.

All the generated files are left in a newly-created directory "/tmp/grtest" (see the script for specifics).

2. Screen shot of evince showing output from "groff -Tpdf" (bad rendering)

3. Screen shot of evince showing output from "groff -Tps" (correct)

4. Screen shot of evince showing result of groff -Tpdf | pdf2ps (correct)


Thanks for any help or suggestions!

-Jim Avera

Attachment: grofftest.bash
Description: Text document

Attachment: groffTpdf_evince.png
Description: PNG image

Attachment: groffTps_evince.png
Description: PNG image

Attachment: pdf2ps_evince.png
Description: PNG image


reply via email to

[Prev in Thread] Current Thread [Next in Thread]