[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [groff] Something broke embedded fonts in gropdf output (but not gro
Re: [groff] Something broke embedded fonts in gropdf output (but not grops)
Fri, 16 Feb 2018 16:35:48 +0000
KMail/4.14.10 (Linux/4.4.105-desktop-1.mga5; KDE/4.14.35; x86_64; ; )
On Thu 15 Feb 2018 17:06:40 Jim Avera wrote:
> 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.
I believe the problem is because there is no "download" file in the font
directory. Any font which is not one of the 14 base type 1 files which all pdf
viewers must know about, must have an entry in download file so that gropdf
can actually embed the font in the pdf. If the entry is missing in the
download file, or no download file, then it is not embedded and the viewer has
to make a "best guess" as to which font to use. Now, since you set
GS_FONTPATH, any program which uses ghostscript (i.e. gv) is likely to find
the correct fontfiles to use, but anything which does not use ghostscript,
using its own display engine (i.e. evince) is likely to choose the wrong font.
This is why it is necessary for the actual font file to be included in the
pdf, so that the viewer does not have to find the correct file in the host
I added these lines to your bash script:-
cat >groff_font_lib/devpdf/download <<'EOF'
# foundry ps name psfile
at line 7651, and evince now shows the attached png file. As you can see the
top line is now correct, and if I look at the font properties in okular it
shows CourierHP as fully embedded, but for the other HP fonts it has chosen
its own fonts.
You may like to investigate the "install-font.sh" script on Peter Schaffter's
This may do what you want.
Description: PNG image
Description: PNG image