简体   繁体   中英

ghostscript stubbornly refuses to embed fonts

I have a document created from pdflatex, embedding R pdf graphs. I am now trying to send it to a printer (lulu) who demands all fonts be embedded. me thinks, no problemo,

# gs -dNOPAUSE -dBATCH -dNOPLATFONTS -sDEVICE=pdfwrite \
  -dEmbedAllFonts=true -sOutputFile=book-gs.pdf -f book.pdf

but to my disappointment, some fonts still do not get embedded:

# pdffonts book-gs.pdf | egrep 'no  [yn]'
name                                 type              encoding         emb sub uni object ID
ZapfDingbats                         Type 1            ZapfDingbats     no  no  yes   1170  0
Symbol                               Type 1            Symbol           no  no  no    1933  0

strangely, the pdf document prints and looks just fine, so the fonts must somehow be alive. I have tried something similar with the adobe acrobat program, but I am getting the same problem.

advice appreciated.

sincerely, /iaw

For the benefit of anyone else with this same problem; the problem here is that there are three parameters affecting font embedding, and they interact in somewhat confusing ways (sorry but these parameters were defined by Adobe, not us...)

There are /NeverEmbed, an array of fonts which are never to be embedded, /AlwaysEmbed, an array of fonts which are always to be embedded (if used, obviously) and /EmbedAllFonts.

You cannot put fonts into both NeverEmbed and AlwaysEmbed, that's an error.

If you set fonts in AlwaysEmbed, they will be embedded, regardless of the setting of EmbedAllFonts.

If you set fonts in NeverEmbed, they will never be embedded, regardless of the setting of EmbedAllFonts.

If a font is in neither the AlwaysEmbed or the NeverEmbed list, then it will be embedded if EmbedAllFonts is true, and not embedded otherwise.

Now, Ghostscript starts with EmbedAllFonts true, so you don't need to fiddle with that unless you want to set it to false for some reason. So.... why does it not embed the standard fonts ? Well that's because the NeverEmbed list is set by default to include all the base 13 fonts. (this is documented under Distiller Parameters).

So, if you want to embed these fonts you either need to use PDFSETTINGS=/prepress or /printer, or you need to set NeverEmbed to empty. I'd recommend the latter:

-c "<</NeverEmbed []>> setdistillerparams" -f

Could it be that Courier/Helvetica is actually embedded by default? When it comes to MiKTeX's ghostscript (mgs), it seems that one for 64-bit embeds them on default, while the one for 32-bit does not. See: https://github.com/MiKTeX/miktex/issues/296 . Kind regards, Ivan

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM