29

For a publisher I have to generate a pdf file which does not contain any Type3 fonts.

Until now I thought that using pdflatex on current LaTeX distributions should be enough to get a pdf file without any Type3 fonts, but for the current document this is not true:

$ pdffonts paper.pdf
name                                 type              emb sub uni object ID
------------------------------------ ----------------- --- --- --- ---------
ZFUCHW+NimbusRomNo9L-Medi            Type 1            yes yes no      41  0
VNQOQC+NimbusRomNo9L-Regu            Type 1            yes yes no      42  0
[none]                               Type 3            yes no  no      43  0
NXAFJF+NimbusRomNo9L-ReguItal        Type 1            yes yes no      46  0
CBNMRR+NimbusRomNo9L-MediItal        Type 1            yes yes no      48  0
MNSAJN+NimbusRomNo9L-Regu-Slant_167  Type 1            yes yes no      52  0
FJTKHV+CMSY7                         Type 1            yes yes no      53  0
VVITQE+CMMI9                         Type 1            yes yes no      54  0
CHSHRJ+CMR9                          Type 1            yes yes no      56  0
EAPUQB+CMR6                          Type 1            yes yes no      57  0
KBHVYI+CMMI6                         Type 1            yes yes no      58  0
EHULJT+CMTI9                         Type 1            yes yes no      59  0
JLLCEK+CMSY9                         Type 1            yes yes no      61  0
YEIEPQ+CMEX9                         Type 1            yes yes no      64  0
DFKMIY+CMSY8                         Type 1            yes yes no      84  0
NEDAGG+CMSY6                         Type 1            yes yes no      87  0
QDTWCG+MSBM10                        Type 1            yes yes no     127  0
[none]                               Type 3            yes no  no     198  0
OKAOPP+CMMI8                         Type 1            yes yes no     199  0
TIGOKK+CMR8                          Type 1            yes yes no     200  0
GWSFMB+CMTI8                         Type 1            yes yes no     201  0
[none]                               Type 3            yes no  no     397  0

I am surprised that all the Type3 fonts haven't a real name.

The document uses the sigplanconf documentclass. For figures only the tikz and listings packages are used (no graphicx package is used, i.e. no \includegraphics is used and no postscript files are embedded).

I am using Ubuntu 10.04 with TeX Live:

$ pdflatex --version
pdfTeX 3.1415926-1.40.10-2.2 (TeX Live 2009/Debian)

I have found an ACM FAQ about Type1 fonts, but it seems to be outdated and the suggested method still yield pdf files with Type3 fonts.

pk fonts: Looking for pk fonts in the doc.log find I found this ouput:

 75i,27n,56p,866b,2711s stack positions out of 5000i,500n,10000p,200000b,50000s
 </mnt/max/.texmf-var/fonts/pk/ljfour/jknappen/ec/ectt0800.600pk> </mnt/max/.texmf-var/fonts
 /pk/ljfour/jknappen/ec/ectt0900.600pk>{/usr/share/texmf-texlive/fonts/enc/dvips/base/8r.enc} 
 </mnt/max/.texmf-var/fonts/pk/ljfour/jknappen/ec/ecss0900.600pk>

What could be reasons for this? Is some font package missing? Or has it something to do with tikz?

  • 1
    Installing the cm-super fonts package seems to be the easy answer to me. – user18839 Sep 17 '12 at 20:18
  • @Ryan, this is already mentioned in an upvoted comment of the accepted answer. Please upvote it as well. You could even post a new short answer to the same effect - which I would upvote. – maxschlepzig Sep 20 '12 at 18:11
  • 1
    In my case, what caused my pdf to have type 3 fonts is that I used the bbm package for the mathematical indicator sign. – omerbp Aug 18 '16 at 8:29
10

Look at the end of the log-file of pdflatex. It will tell you which fonts are included and which are bitmap (pk) fonts.

  • Thanks, I've found some pk fonts the log file (see the update) - I have no real idea, where they are coming from, though ... – maxschlepzig May 20 '11 at 13:27
  • 6
    Install the cm-super fonts. – Ulrike Fischer May 20 '11 at 14:02
  • 1
    thanks a lot, with the cm-super package installed there aren't any Type3 fonts included anymore in the pdf file. – maxschlepzig May 20 '11 at 14:09
  • 3
    The bbm package, which you might want to use to write blackboard bold numbers, is a source of Type 3 fonts. Try the dsfont package instead. – nemarona May 27 '15 at 15:42
7

A Type 3 font is not by default a bitmap font. It means only not a Type 1 one. This is the reason why a Type 3 font can also be a vector font. If there is no listed pk font in the log file, then you have such a type 3 font included. It may also be loaded by an image with \includegraphics

  • Ok, I've found some pk fonts and I am not using includegraphics (updated the question). – maxschlepzig May 20 '11 at 13:29
  • then show exactly your font setting in the preamble. However, it looks like that you are using the package times instead of mathptmx. Right? – user2478 May 20 '11 at 14:00
  • no, I am not using the times package - the system was missing the cm-super package - see my comment to Ulrike Fischer's answer. – maxschlepzig May 20 '11 at 14:12
5

First off, most people use pdflatex nowadays. Change every image to pdf if possible replacing eps files by pdf using

     convert file.eps file.pdf

convert is found in the imagemagick package. Remove epsfig and use includegraphics instead.

Next run:

     pdffonts final_upload_document.pdf | less

to ensure that a type 3 font problem is actually the issue. If it isn't then the problem is most likely related to spaces in file names.

Next run:

     pdffonts each_image.pdf

to find any type 3 fonts on the individual pdf files to find which image is causing the problem. It could be an xfig or matlab problem, or a problem from another image generator.

If the contained pdfs don't create the issue, then it is most likely an include such as blackboard fonts that is causing the problem inside the source latex file.

Using the above method I found in particular that xfig in addition to matlab can cause the same artefacts if you are using export to latex+pdf part.

When you find the pdf + latex file you can run:

  xfig -specialtext -latexfonts -startlatexFont default

to start up xfig with the right settings. You also might find as in my case that the xfig image was generated some years ago that was to go into the paper, and that it now doesn't even open in newer versions of xfig giving a sigsegv fault. In this case your only option is to regenerate the image using the above xfig call.

  • 3
    Very interesting, I found the exact source of the xfig Type 3 font problem. It occurs not in the text fonts, but in the patterned polylines. If you use filled instead of patterned polylines and export to pdf/latex, you will then find that pdffonts will not return a type 3 font on your pdf. – Eamonn Kenny Nov 12 '15 at 12:52
4

I solved this by adding the following command to the head of my latex file:

\pdfminorversion=4              % tell pdflatex to generate PDF in version 1.4
  • Can you be a little more explicit in what this is ... answers get reordered by votes and the antecedent is no longer clear. Maybe this answer should be a comment to another answer (than it it not moved away from it)? – jknappen Jan 17 '17 at 16:34
  • Sorry, I am unable to say why this worked for me. In case somebody else has insight, he is free to edit my answer and extend it. – Peter Pablo Jan 17 '17 at 17:48
3

When including graphics coming from matplotlib, they may contain a Type3 font. However, matplotlib can be instructed to use tex rendering and the correct font family:

import matplotlib.pyplot as plt

plt.rc('text', usetex=True)
plt.rc('font', family='serif')
  • I had a similar problem and in my case figures generated by matplotlib were the ultimate culprit. Thanks for this answer! – Dan Bonachea Jan 26 at 3:46
  • I tried this and ran pdffonts fig.pdf on the output figure from matplotlib and it was still chock full of the type 3 fonts – travelingbones May 10 at 18:16
  • This did not work for me, but i agree matplotlib figures were the culprit. This other solution worked for me: phyletica.org/matplotlib-fonts – travelingbones May 14 at 13:58
2

As a complement to the answer by Eamonn Kenny: once you have identified the offending figure containing the problematic font, opening it in Inkscape and exporting it to PDF with the export option "convert text to paths" gets rid of all fonts.

In my case, the publisher website still gave a vague error message, and the solution by Peter Pablo solved it finally: forcing PDF v1.4 ensured compatibility

N.B. I have too low a reputation to comment or upvote, hence this post.

1

cm-super did not work for me, as it turns out that the Type-3 fonts were loaded from the pictures. The easiest fix: just save your pdf file with Apple Preview or Adobe Reader and it will do the trick!

  • Welcome! This does not answer this question because you, unlike the OP, were including external images which used type3 fonts. On the other hand, the OP, unlike you, had type3 fonts solely as a result of not having type1 versions of the T1-encoded CM fonts available. Obviously, cm-super won't help in your case, but neither will your suggestion help in the OP's. That is, you have a quite distinct problem which is unrelated to this one. Have I missed something? – cfr Mar 6 '18 at 1:44
  • @cfr it might be a different issue, but googling brought me here, and my problem is more similar to Mauro's problem so it is helpful to me to know of this approach. – FionaSmith Aug 29 '18 at 1:55
  • @FionaSmith To say that it does not answer the question is not to say that it may not be a useful answer to a different question. So it may be useful to you, but it still doesn't answer this question. For one thing, the OP clearly can't use Apple Preview and almost certainly can't use Adobe Reader either. – cfr Aug 29 '18 at 23:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.