Bug 688251 - pdfwrite fails to embed type 42 font
Summary: pdfwrite fails to embed type 42 font
Status: NOTIFIED INVALID
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PDF Writer (show other bugs)
Version: master
Hardware: PC Linux
: P3 normal
Assignee: Stefan Kemper
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-01 06:23 UTC by Steinar H. Gunderson
Modified: 2008-12-19 08:31 UTC (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments
Sample PostScript file exhibiting the problem (217.26 KB, application/postscript)
2005-08-01 06:25 UTC, Steinar H. Gunderson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steinar H. Gunderson 2005-08-01 06:23:46 UTC
(This is also Debian bug #320786 (
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=320786 ).)

I have a very large (~200MB) PostScript file originally exported from
PageMaker 6.5, which I'd like to turn into PDF. However, this file also
contains a few TrueType fonts which I'd like to embed in the PDF
(subsetted), since they don't look very much like the 13 included
standard fonts. However, that simply doesn't happen.

The fonts _are_ there alright -- if I show the .ps file in gv, they get
rendered perfectly -- but even with -dDEBUG I can't find the slightest
hint that gs recognizes them. I've tried various flags; my current set
goes something like this:

  gs -dPDFSETTINGS=/printer -dCompatibilityLevel=1.4
  -dMaxSubsetPct=100 -dSubsetFonts -dEmbedAllFonts -dNOPAUSE -dBATCH
  -sDEVICE=pdfwrite -sOutputFile=out.pdf -c .setpdfwrite -f in.ps

but pdffonts still claims the fonts aren't included (and gv, xpdf and
acroread agree):

  name                                 type         emb sub uni object ID
  ------------------------------------ ------------ --- --- --- ---------
  |______TTE155C6B8T00                 TrueType     no  no  no      12 0
  |______ArialMT                       Type 1       no  no  no      16 0
  |______TimesNewRomanPSMT             Type 1       no  no  no       9 0
  |______TTE18B8428T00                 TrueType     no  no  no      29 0
  |______TimesNewRomanPS-ItalicMT      Type 1       no  no  no      25 0
  |______TTE15655E8T00                 TrueType     no  no  no      27 0
  |______Palatino-Roman                Type 1       no  no  no      56 0

The only luck I've really had is specifying all the TTE names manually
in AlwaysEmbed -- in this case, they are listed as embedded (and
subsetted), but are rendered as bitmaps, which doesn't really do it :-)

Any good ideas? Everything I've found on the 'net says that this is just
supposed to work transparently, and by looking at the PostScript file,
it really looks like it defines lots of characters for the given TTE*
fonts (I'm no PostScript guru, though).

I've successfully edited the original PostScript down to a ~250kB file with a
single page without images; I'll be attaching it in the bug report below.
Comment 1 Steinar H. Gunderson 2005-08-01 06:25:18 UTC
Created attachment 1588 [details]
Sample PostScript file exhibiting the problem

Reduced testcase with no images and only one used font. (Note that GhostScript
substitutes away Times New Roman and Arial, but that's OK -- the real problem
is that is doesn't embed Impact, which has the name TTE155C6B8T00 in this
file.)
Comment 2 Alex Cherepanov 2005-08-01 08:56:00 UTC
Ghostscript works almost as designed.
The file specifies <</EmbedAllFonts false >> distiller parameter.
So the fonts are not embedded. Distiller doesn't embed the fonts
either.

The file also specifies <</CompatibilityLevel 1.1 >>.
Acrobat distiller ignores this parameter and generates PDF 1.4.
Ghostscript is confused by the requested version. By some reason, it
converts one of the fonts to Type 3 when CompatibilityLevel <= 1.2 .


Comment 3 Steinar H. Gunderson 2005-08-01 09:21:30 UTC
Heh, that was quite unexpected :-) I had no idea at all that the .ps file would
override my command-line settings, but thinking of it, it makes sense.

Anyhow, grepping out the offending lines makes a PDF file with the fonts just as
I'd want them. Thanks!